From 2d145b026cfdf54a63bef0b9d6324b6785390307 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 14 Sep 2018 12:18:12 -0400 Subject: move finished folder --- finished-application/frontend/pages/_document.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 finished-application/frontend/pages/_document.js (limited to 'finished-application/frontend/pages/_document.js') diff --git a/finished-application/frontend/pages/_document.js b/finished-application/frontend/pages/_document.js new file mode 100644 index 0000000..0ac8935 --- /dev/null +++ b/finished-application/frontend/pages/_document.js @@ -0,0 +1,23 @@ +import Document, { Head, Main, NextScript } from 'next/document'; +import { ServerStyleSheet } from 'styled-components'; + +export default class MyDocument extends Document { + static getInitialProps({ renderPage }) { + const sheet = new ServerStyleSheet(); + const page = renderPage(App => props => sheet.collectStyles()); + const styleTags = sheet.getStyleElement(); + return { ...page, styleTags }; + } + + render() { + return ( + + {this.props.styleTags} + +
+ + + + ); + } +} -- cgit v1.3