-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
display-name has false positive on nested use of memo and forwardRef #2954
Comments
In which React versions is that fixed in React? We should only consider that satisfactory in those versions. |
I'm unsure, but judging by the date, it should have gone in somewhere in the React 16 cycle. |
Clicking on the commit that merged the PR implies it's actually gone out in v0.14.10, v15.7.0, and v16.12.0+ - so that's the range we should be using. |
I'd like to work on this! |
If I understand correctly, the |
However, the specific nested case should complain - unless React is one of the versions mentioned here, in which case it should not complain. To handle that in the code, the |
Since #2399,
eslint-plugin-react
knows not to complain about code like this:In that pull request, nested use of
memo
andforwardRef
like so......was intentionally treated as a
display-name
violation due to a React bug causing such components to be anonymous. This issue was solved in November 2019, so thedisplay-name
should now accept this.The text was updated successfully, but these errors were encountered: