-
Notifications
You must be signed in to change notification settings - Fork 46.4k
New issue
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
Bug: eslint exhaustive-deps doesn't recognize JSXIdentifier as used #18937
Comments
Can I pick this up? |
@sophiebits would what you're doing not be better solved by const Child = React.memo(() => <Report />) |
@yanneves Not quite. See the second code example in https://reactjs.org/docs/hooks-faq.html#how-to-memoize-calculations for more detail on the pattern I'm using. |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Duplicate of #18051 |
says that
Report
is an unnecessary dependency. It's not.This is because eslint scope
.references
does not include JSX. I suspect if you pull inhttps://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/jsx-uses-vars.js
to your app's config then this won't happen. But maybe we should do something in the Hooks plugin itself too (since the others aren't officially recommended by the React team anyway).
The text was updated successfully, but these errors were encountered: