reactjs / react.dev

The React documentation website
https://react.dev/
Creative Commons Attribution 4.0 International
11.05k stars 7.54k forks source link

[Docs examples] Change proptypes import and usage to use `propTypes` not `PropTypes` #2046

Open ahtee opened 5 years ago

ahtee commented 5 years ago

https://reactjs.org/docs/typechecking-with-proptypes.html

When importing the proptypes library, eslint warns you that you should be using the camelCase format of propTypes and not use PascalCase PropTypes.

Other pages that may need updating: https://reactjs.org/docs/static-type-checking.html https://reactjs.org/docs/legacy-context.html#how-to-use-context

:)

malakhov-dmitrii commented 5 years ago

As I know, propTypes in component class is a public property, so it is camelCase, PropType as type-checker is a class and type is a method, which makes all necessary type checks in general, so you probably should configure your ESLint settings.