-
-
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
Enhancement: added option checkKeyMustBeforeSpread of react/jsx-key
#2830
Comments
facebook/react#20031 (comment) suggests the opposite - that the key must be after the spread so react can statically know which one will "win". |
Let's wait until that issue gets some resolution before implementing anything here. |
@ljharb Yes. we need waiting. Just put the issue here for tracking. babel and typescript already have implemented this logic. So i'm not optimistic to they will change it. and typescript and babel have diffrent fallback results. typescript is not use if nothing changed. This eslint rule is really needed. |
Sounds like we'll want to make a rule that warns when the key appears after the spread, despite that being highly counterintuitive. |
seems this may a temporary rule until react evolution completed. maybe as a option of |
I like that better. |
react/jsx-key
jsx-runtime
landed. but there have different transform results when key before or after props spreadfacebook/react#20031
to avoid the fallback to using
createElement
,need a rule to limit the key before spread.
The text was updated successfully, but these errors were encountered: