CoastalCommitsPastes/client/pages/_document.tsx

40 lines
643 B
TypeScript
Raw Normal View History

2022-11-09 21:38:05 -05:00
import { CssBaseline } from "@geist-ui/core/dist"
2022-04-09 20:48:19 -04:00
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}
</> // TODO: Investigate typescript
) as any
2022-04-09 20:48:19 -04:00
}
}
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