CoastalCommitsPastes/client/pages/_document.tsx

40 lines
599 B
TypeScript
Raw Normal View History

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