Hi,
I've got an issue with code like this
DueEntryComponent.propTypes = {
"isOverdue": PropTypes.bool
};
DueEntryComponent.defaultProps = {
"isOverdue": false
};
triggers the message:
propType "isOverdue" is not required, but has no corresponding defaultProp declaration. (react/require-default-props)
changing the declaration to
DueEntryComponent.defaultProps = {
isOverdue: false
};
omits the error.
I don't think quotes should have an effect on detecting defaultProps. Maybe I'm wrong ;-)
While unnecessarily quoted keys isn't my preferred style, I agree this should work. I think it should also work as a computed template literal with no interpolations.
Fixed it for quoted properties. I will add template literal support in another patch.
Most helpful comment
Fixed it for quoted properties. I will add template literal support in another patch.