Commit 64aa4454 authored by nkzawa's avatar nkzawa

examples: fix SSR of styled-components

parent 33fa9312
...@@ -3,7 +3,6 @@ import styleSheet from 'styled-components/lib/models/StyleSheet' ...@@ -3,7 +3,6 @@ import styleSheet from 'styled-components/lib/models/StyleSheet'
export default class MyDocument extends Document { export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) { static async getInitialProps ({ renderPage }) {
styleSheet.flush()
const page = renderPage() const page = renderPage()
const style = styleSheet.rules().map(rule => rule.cssText).join('\n') const style = styleSheet.rules().map(rule => rule.cssText).join('\n')
return { ...page, style } return { ...page, style }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment