Skip to content
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

injectGlobal vs resetStyles in _document.js #54

Closed
pronevich opened this issue Jul 3, 2017 · 3 comments
Closed

injectGlobal vs resetStyles in _document.js #54

pronevich opened this issue Jul 3, 2017 · 3 comments
Labels

Comments

@pronevich
Copy link

Is there some reason why you have used resetStyles object/string in _document.js instead injectGlobal() ?

@kitten
Copy link
Member

kitten commented Jul 3, 2017

Yes, a couple of things still misbehave since next.js has not added an API for wrapping the app yet: https://github.com/styled-components/styled-components-website/blob/master/pages/_document.js#L140

So some code is not migrated / changed yet and just there to "make things work". 😉 😆

@kitten kitten closed this as completed Jul 3, 2017
@kitten kitten added the question label Jul 3, 2017
@pronevich
Copy link
Author

pronevich commented Jul 3, 2017

@philpl Is there any drawbacks to use <ThemeProvider> for each page?

@kitten
Copy link
Member

kitten commented Jul 3, 2017

@pronevich this page is not using the ThemeProvider, but no. Apart from the duplication there's no harm. But repeating yourself is often bad practice, so it should be avoided.

I'm not sure whether you're referring to the stylesheet manager instead? It can't be repeated, since we need to inject the resulting style tags into the head of the document statically during SSR.

Please move questions unrelated to this site into a new issue on the SC repo :)

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

No branches or pull requests

2 participants