-
-
Save zsherman/a8711187724db5ac96b4c4e391f245a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Document, { Head, Main, NextScript } from 'next/document' | |
import { ServerStyleSheet } from 'styled-components' | |
import 'styles/global-styles'; | |
export default class SiteDocument extends Document { | |
render () { | |
const sheet = new ServerStyleSheet() | |
const main = sheet.collectStyles(<Main />) | |
const styleTags = sheet.getStyleElement() | |
return ( | |
<html> | |
<Head> | |
<meta charSet="utf-8" /> | |
<meta name="viewport" content="initial-scale=1.0, width=device-width" /> | |
{styleTags} | |
</Head> | |
<body> | |
<div className="root"> | |
{main} | |
</div> | |
<NextScript /> | |
</body> | |
</html> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment