Skip to content

Commit 623ba3f

Browse files
authored
refactor(component): improve document component (#68)
1 parent 3d0f393 commit 623ba3f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/web/pages/_document.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Document, { Head, Main, NextScript, Html } from 'next/document';
44
import React from 'react';
55

66
export default class Doc extends Document {
7-
static override getInitialProps = async (context: DocumentContext) => {
7+
static override async getInitialProps(context: DocumentContext) {
88
const { renderPage: originalRenderPage } = context;
99

1010
// Run the React rendering logic synchronously
@@ -22,10 +22,10 @@ export default class Doc extends Document {
2222
};
2323

2424
// Run the parent `getInitialProps`, it now includes the custom `renderPage`
25-
return await Document.getInitialProps(context);
26-
};
25+
return await super.getInitialProps(context);
26+
}
2727

28-
override render = () => {
28+
override render() {
2929
return (
3030
<Html lang="en">
3131
<Head>
@@ -43,5 +43,5 @@ export default class Doc extends Document {
4343
</body>
4444
</Html>
4545
);
46-
};
46+
}
4747
}

0 commit comments

Comments
 (0)