importing the CSS helper from @emotion/css instead of @emotion/react seems to not work
See original GitHub issueCurrent behavior:
If I have @emotion/css
as a dependency (which I do because I need to disable speedy
for puppeteer/prerender.io runs) then whenever I try to use the css
prop with the css
helper, TypeScript suggests to import the css
helper from @emotion/css
instead of @emotion/react
. but if I actually use that, it has no effect on the actual page.
I’m using the emotion babel plugin, in a CRA app that uses craco
to edit the babel
config.
I work around this by adding a restricted import ESLint rule to yell at any and all who try to use the css
helper from a @emotion/css
import.
To reproduce:
https://www.github.com/osdiab/emotion-css-prop-repro
Expected behavior:
It works to avoid confusing my teammates
Environment information:
"dependencies": {
"@craco/craco": "^6.1.2",
"@emotion/core": "^11.0.0",
"@emotion/css": "^11.1.3",
"@emotion/react": "^11.4.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
},
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
The css Prop - Emotion
The primary way to style elements with emotion is the css prop. It provides a concise and flexible API to style your components....
Read more >react-emotion's CSS not present in DOM - Stack Overflow
It's currently a problem with Chrome. Emotion uses some kind of Chrome magic, so it doesn't need to render it's CSS to the...
Read more >Style library interoperability - Material UI - MUI
Plain CSS; Global CSS; Styled Components; CSS Modules; Emotion ... import * as React from 'react'; import Slider from '@mui/material/Slider'; import '.
Read more >FAQs - styled-components
At this time we do not recommend using @import within cGS due to some issues ... In general, always use the css helper...
Read more >Use CSS or SCSS instead of Emotion? - Get Help
Then, instead of import CSS files directly (we don't allow CSS files ... This may not seem important, but when you work with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hope below code fragment help you or anyone
@Andarist - can you add this (or a link to it) to the SSR documentation? The puppeteer solution in the doco did not work for me but this did.
Sorry OP for hijacking your ticket.