纯渲染函数的 PropTypes eslint 错误

PropTypes eslint error with pure render function

我有以下纯渲染组件:

import React, { PropTypes } from 'react';
import Dropzone from 'react-dropzone';

export const renderDropzone = ({ name, input: { onChange } }) => {
  return (
    <div>
      <Dropzone
          name={name}
          onDrop={filesToUpload => onChange(filesToUpload)}
      />
      <button type="button" className="button">Upload</button>
    </div>
  );
};

renderDropzone.PropTypes = {
  name: PropTypes.string.isRequired,
  input: PropTypes.object.isRequired
};

但我在 eslint 中收到以下错误:

  4:34  error  'name' is missing in props validation   react/prop-types
  4:40  error  'input' is missing in props validation  react/prop-types

只是一个错字:

renderDropzone.PropTypes = {
  name: PropTypes.string.isRequired
};

应该是:

renderDropzone.propTypes = {
  name: PropTypes.string.isRequired
};

(小写 'p' 在 class 属性 上)