Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Fix FOUC server rendered Styled-components #16

Open
RyanCCollins opened this issue Feb 21, 2017 · 2 comments
Open

Fix FOUC server rendered Styled-components #16

RyanCCollins opened this issue Feb 21, 2017 · 2 comments

Comments

@RyanCCollins
Copy link
Collaborator

I am not sure why, but the server-rendering of styled-components seems to fail. This is working on scalable-react-boilerplate (located here). It must be a regression in styled-components.

@sfleck
Copy link
Contributor

sfleck commented Feb 25, 2017

What makes you think this is failing? I see the raw HTML using "View page source" when running the Production server. Is there a specific page/component that you are looking at?

I agree there is no server side rendering in the dev environment.

@RyanCCollins
Copy link
Collaborator Author

RyanCCollins commented Feb 25, 2017

When you transition to a new route whose bundle is not yet loaded on the prod site, you will see a flash of unstyled content. I have it configured to inject the styles from the site into the head, but for some reason it misses it on the initial server-render.

I will post a link to the production site. Just a moment.

EDIT: it looks like this is only happening on full reload now because we are using react-router behind the scenes for page transitions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants