I created a CRUD app using Redux so, I write code and when export the component I added this line:
AddContact.PropTypes = {
addContact: PropTypes.func.isRequired
};
export default connect(null, { addContact })(AddContact);
But, It's showing this error
./src/components/contact/AddContact.js
Line 461:12: Typo in static class property declaration react/no-typos
Search for the keywords to learn more about each error.
should be [p with lower key]
AddContact.propTypes
Documentation => https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-typos.md
The issue is in the casing.
we usually import PropTypes as:
import PropTypes from 'prop-types'
We imported as PropTypes But while using with a React component. we use it with smaller case propTypes . example.
Blog.propTypes = {
blog: PropTypes.object.isRequired
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With