mirror of
https://github.com/BradNut/weddingsite
synced 2025-09-08 17:40:36 +00:00
25 lines
622 B
JavaScript
25 lines
622 B
JavaScript
import Document, { Html, Head, NextScript, Main } 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(<App {...props} />)
|
|
);
|
|
const styleTags = sheet.getStyleElement();
|
|
return { ...page, styleTags };
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<Html lang="en-US">
|
|
<Head />
|
|
<body>
|
|
<Main />
|
|
<NextScript />
|
|
</body>
|
|
</Html>
|
|
);
|
|
}
|
|
}
|