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:
- Open this Sandbox: https://codesandbox.io/s/bug-rendertostring-with-react-18-7ty15q
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.0
react-dom version: 18.0.0
@emotion/react version: 11.9.0
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
BlockColorGreenshould 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:
reactversion: 18.0.0react-domversion: 18.0.0@emotion/reactversion: 11.9.0