-
Notifications
You must be signed in to change notification settings - Fork 16
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
Styled components #28
Comments
Do you think this could be part of version 3.0? I got this working with styled-components v2.0.0-7 by installing ssrwpo locally and adding See https://github.com/diegohaz/arc/blob/fullstack/src/server.js#L77 for an example of SSR working with styled-components 1.4.4. |
Indeed, this out to be in our 3.0! |
Hey! @Morganjackson are you interested to do this? For this project, I don't want it to be a "one man knows it all". It's out to be a community based effort. |
@PEM-- I'm happy to contribute anyway I can, however I'm sure there is a better way to handle this than what I have hacked together. import { styleSheet } from 'styled-components'; if (!stepResults.hasUnwantedQueryParameters) {
bodyMarkup = renderToString(app);
css = styleSheet.getCSS()
helmetHead = rewind();
} if (stepResults.body === null) {
stepResults.head = `<style type="text/css">${css}</style>`
stepResults.body = `<div id="react">${bodyMarkup}</div>${stepResults.contextMarkup}`;
} This works but I think it should be in |
@Morganjackson I've just invited you on our Slack account. It would be easier to start this new journey. @mxstbr's work is assuredly part of it 😉 |
This is done. Now we just need to keep up with the styled-components potential API changes. |
Styled components allows specific behavior depending on its rendering origin:
Using styled-components, we can avoid the FOUC (Flash Of Unknown Css) that plagues SPA and delay styles loading so that the HTML payload renders even faster its TTFB (Time To First Byte) with the real and appropriate styled tags.
The text was updated successfully, but these errors were encountered: