-
Notifications
You must be signed in to change notification settings - Fork 49.9k
Turn on key spread warning in jsx-runtime for everyone #25697
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
This should suggest that the key is put first, not last.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,9 +282,12 @@ describe('ReactElement.jsx', () => { | |
| expect(() => | ||
| ReactDOM.render(JSXRuntime.jsx(Parent, {}), container), | ||
| ).toErrorDev( | ||
| 'Warning: React.jsx: Spreading a key to JSX is a deprecated pattern. ' + | ||
| 'Explicitly pass a key after spreading props in your JSX call. ' + | ||
| 'E.g. <Child {...props} key={key} />', | ||
| 'Warning: An props object containing a "key" prop is being spread into JSX:\n' + | ||
| ' let props = {key: ...};\n' + | ||
|
||
| ' <Child {...props} />\n' + | ||
| 'React keys must be passed directly to JSX without using spread:\n' + | ||
| ' let props = {};\n' + | ||
| ' <Child key={...} {...props} />', | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.