diff --git a/pages/_document.js b/pages/_document.js index 9ebf2d4..a118b07 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -1,7 +1,13 @@ import React from 'react'; import Document, { Head, Main, NextScript } from 'next/document'; +import flush from 'styled-jsx/server'; class Page extends Document { + static getInitialProps({ renderPage }) { + const { html, head, errorHtml, chunks } = renderPage(); + const styles = flush(); + return { html, head, errorHtml, chunks, styles }; + } render() { return (