CoastalCommitsPastes/client/pages/_document.tsx

31 lines
760 B
TypeScript
Raw Normal View History

import { CssBaseline } from '@geist-ui/core'
2022-03-06 19:46:59 -05:00
import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext) {
const initialProps = await Document.getInitialProps(ctx)
const styles = CssBaseline.flush()
return {
...initialProps,
styles: (
<>
{initialProps.styles}
{styles}
</>
)
}
}
render() {
return (<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>)
}
}
export default MyDocument