Styled-components-website: injectGlobal vs resetStyles in _document.js

Created on 3 Jul 2017  路  3Comments  路  Source: styled-components/styled-components-website

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

question

All 3 comments

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". :wink: 馃槅

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

@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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johannesnagl picture johannesnagl  路  4Comments

mxstbr picture mxstbr  路  4Comments

markatk picture markatk  路  5Comments

kitten picture kitten  路  7Comments

mxstbr picture mxstbr  路  3Comments