-
-
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
react/display-name false positive in render prop ternary #2224
Comments
In this case, the arrow function is considered a component. It seems worth improving our component detection to avoid render props - cc @alexzherdev |
Just a side-note, but I would rather expect ternary inside of callback instead of passing callback if ternary is fulfilled. |
@jzabala your screenshot shows that the false positive does happen? |
Sorry for the confusing screenshot 😅 . I wanted to show that the rule was active, since it is triggered at the bottom, but it is not triggered in the case reported in the issue (the ternary). So, this issue is fixed in the specified versions. |
ah, thanks. Closing, then :-) |
The
react/display-name
rule has a false positive error when a component render prop is a ternary containing an arrow function expression:This does not have an error:
So the ternary must confuse the rule somehow.
The text was updated successfully, but these errors were encountered: