We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When deep-destructuring component properties (in a functional component), 'react/no-unused-prop-types' is reported for the top level property:
import { intlShape, injectIntl, } from 'react-intl'; import messages from './some-component.intl'; function SomeComponent({ intl: { formatMessage } }) { return ( <img title={ formatMessage(messages.imageTitle) } /> ); } SomeComponent.displayName = 'SomeComponent'; SomeComponent.propTypes = { intl: intlShape.isRequired, }; SomeComponent.defaultProps = {}; export default injectIntl(SomeComponent);
reports "'intl' PropType is defined but prop is never used".
Possible workaround:
function SomeComponent({ intl }) { const { formatMessage } = intl; return ( <img title={ formatMessage(messages.imageTitle) } /> ); }
I checked open issues, but didn't find any matching this exact case.
The text was updated successfully, but these errors were encountered:
I am 97% sure this is a duplicate of #2424, and is fixed by #2428, but not yet released.
Sorry, something went wrong.
Yup, looks like it - didn't see that one for some reason. Thanks and have a good day!
No branches or pull requests
When deep-destructuring component properties (in a functional component), 'react/no-unused-prop-types' is reported for the top level property:
reports "'intl' PropType is defined but prop is never used".
Possible workaround:
I checked open issues, but didn't find any matching this exact case.
The text was updated successfully, but these errors were encountered: