-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
emotion style does not work when using renderToString in React18 #2906
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
Comments
@Andarist Uhh.... do we support server-side rendering in the browser? 😅 |
Probably the same underlying issue as this one #2691 |
Facing the same issue. Any update on this? |
@chandlervdw I'm not a contributor to emotion, I'm working with @vmaerten that's why I commented 😅 By the way, on our side we have a temporary solution, because we wanted to update to React 18 and this was the only thing that blocked us. What we did was to render the original component in our page, inside a See this codesandbox: https://codesandbox.io/s/bug-rendertostring-with-react-18-forked-m2un7b?file=/src/App.tsx We are not working on performance sensible apps so for us it's enough |
Current behavior:
With React 18 (works in React 17), when we use
ReactDOMServer.renderToString(EMOTION_COMPONENT)
the style is not injected in the head.To reproduce:
Expected behavior:
Div
BlockColorGreen
should be green but no style is applied (class is present but no style injected)Works fine with React 17, please see: https://codesandbox.io/s/not-bug-rendertostring-with-react-17-04vtp2
Environment information:
react
version: 18.0.0react-dom
version: 18.0.0@emotion/react
version: 11.9.0The text was updated successfully, but these errors were encountered: