-
Notifications
You must be signed in to change notification settings - Fork 14
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
SSR of styles from emotion css-in-js library #16
Comments
Here is the example, I'm trying to switch to mantine ui from blueprintjs |
Does Emotion support React 18 streaming? I'm not all to familiar with Emotion, but I believe CSS may be generated during the stream, so Emotion needs to be able to emit CSS live during the stream. Does it have an API for that? Neat, that looks really nice. |
Yes it does have a streaming API, import { renderToNodeStream } from 'react-dom/server'
import { renderStylesToNodeStream } from '@emotion/server'
import App from './App'
const stream = renderToNodeStream(<App />).pipe(renderStylesToNodeStream()) Now the question is, |
I see. FYI React has been doing some work about this: facebook/react#24886. Context: reactjs/rfcs#219 (comment). So I'm not sure what React's recommendation is about this nowadays? I think we should open a ticket over at Emotion see what they think/know about this. |
Closing but let me know if you believe there is something that |
I'm trying to render the initial styles on the server to avoid CLS. Is there a way to do it currently?
ex:
https://emotion.sh/docs/ssr#renderstylestostring
This is what I'm trying but it obviously doesn't work,
The text was updated successfully, but these errors were encountered: