File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
examples/with-styletron/pages Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,23 @@ export default class MyDocument extends Document {
55 static getInitialProps ( { renderPage } ) {
66 const page = renderPage ( )
77 const styletron = flush ( )
8- const css = styletron ? styletron . getCss ( ) : null
9- return { ...page , css }
8+ const stylesheets = styletron ? styletron . getStylesheets ( ) : [ ]
9+ return { ...page , stylesheets }
1010 }
1111
1212 render ( ) {
1313 return (
1414 < html >
1515 < Head >
1616 < title > My page</ title >
17- < style className = '_styletron_hydrate_' dangerouslySetInnerHTML = { { __html : this . props . css } } />
17+ { this . props . stylesheets . map ( ( sheet , i ) => (
18+ < style
19+ className = "_styletron_hydrate_"
20+ dangerouslySetInnerHTML = { { __html : sheet . css } }
21+ media = { sheet . media || '' }
22+ key = { i }
23+ />
24+ ) ) }
1825 </ Head >
1926 < body >
2027 < Main />
You can’t perform that action at this time.
0 commit comments