From e1babdfe9d599584a9e8b79681b4ff48e077bb0d Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Tue, 28 Feb 2017 00:45:49 +0100 Subject: [PATCH] Render styled-jsx in _document example (#1287) --- examples/with-cxs/pages/_document.js | 2 +- examples/with-styled-components/pages/_document.js | 5 ++--- readme.md | 8 +++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/with-cxs/pages/_document.js b/examples/with-cxs/pages/_document.js index 3a04d58c..9b2a7f46 100644 --- a/examples/with-cxs/pages/_document.js +++ b/examples/with-cxs/pages/_document.js @@ -4,7 +4,7 @@ import cxs from 'cxs' export default class MyDocument extends Document { static async getInitialProps ({ renderPage }) { const page = renderPage() - let style = cxs.getCss() + const style = cxs.getCss() return { ...page, style } } diff --git a/examples/with-styled-components/pages/_document.js b/examples/with-styled-components/pages/_document.js index c635408e..384b19b9 100644 --- a/examples/with-styled-components/pages/_document.js +++ b/examples/with-styled-components/pages/_document.js @@ -4,8 +4,8 @@ import styleSheet from 'styled-components/lib/models/StyleSheet' export default class MyDocument extends Document { static async getInitialProps ({ renderPage }) { const page = renderPage() - const style = styleSheet.rules().map(rule => rule.cssText).join('\n') - return { ...page, style } + const styles = styleSheet.rules().map(rule => rule.cssText).join('\n') + return { ...page, styles } } render () { @@ -13,7 +13,6 @@ export default class MyDocument extends Document { My page -