Commit bb3ceaad authored by Sergio Daniel Xalambrí's avatar Sergio Daniel Xalambrí Committed by Tim Neutkens

Fix styled-components server-render example (#1382)

parent 6db7101c
......@@ -4,7 +4,9 @@ import styleSheet from 'styled-components/lib/models/StyleSheet'
export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) {
const page = renderPage()
const styles = styleSheet.rules().map(rule => rule.cssText).join('\n')
const styles = (
<style dangerouslySetInnerHTML={{ __html: styleSheet.rules().map(rule => rule.cssText).join('\n') }} />
)
return { ...page, styles }
}
......
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