-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
10.1.0 jsx implementation causes key errors #2065
Comments
The issue is with this code path: emotion/packages/core/src/jsx.js Lines 20 to 33 in 0abe324
In the dev build, React runs key validation in two places: once in the dev implementation of The So what's going on here is that Emotion is collapsing the tail args into I don't see a way to fix this other than by reverting the part of #1970 that refactors Emotion's |
So the internals of this are way over my head, but this may help someone like me. I was having this issue in development and set But, when I tried to deploy as production, I kept getting a So for the meantime, I'm just defaulting to
|
@billyjanitsch thanks for the detailed repro - I've implemented a fix for this and gonna release it shortly. @litewarp this seems like a separate issue that has been discussed here, please take a look there |
Current behavior:
This component:
Transpiled with
@emotion/babel-preset-css-prop@10.1.0
({runtime: 'classic'}
), using@emotion/core@10.1.0
, produces the following key error:In general, this happens for any element that uses the
css
prop and has two or more children. If you remove thecss
prop, or if you remove either or both children, there is no key error.To reproduce:
See this CodeSandbox. Note that the code is the transpiled output from the Babel preset. (You can't reproduce it on CodeSandbox otherwise because it only manifests with the preset.)
Expected behavior:
There should be no key error.
Environment information:
react
version:^17.0.1
(but reproduces in16.x
as well)emotion
version:10.1.0
The text was updated successfully, but these errors were encountered: