File tree Expand file tree Collapse file tree 1 file changed +16
-19
lines changed
src/test/frameworks/next/pages Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -4,27 +4,24 @@ import { getColorSchemeSsrUtils } from "dsfr-react/lib/nextJs";
4
4
5
5
const { readColorSchemeFromCookie, getColorSchemeHtmlAttributes } = getColorSchemeSsrUtils ( ) ;
6
6
7
- export default class Document extends DefaultDocument {
8
- static async getInitialProps ( ctx : DocumentContext ) {
9
-
10
- const initialProps = await DefaultDocument . getInitialProps ( ctx ) ;
7
+ export default function Document ( ) {
8
+ return (
9
+ < Html { ...getColorSchemeHtmlAttributes ( ) } >
10
+ < Head />
11
+ < body >
12
+ < Main />
13
+ < NextScript />
14
+ </ body >
15
+ </ Html >
16
+ )
17
+ }
11
18
12
- readColorSchemeFromCookie ( ctx ) ;
19
+ Document . getInitialProps = async ( ctx : DocumentContext ) => {
13
20
14
- return { ... initialProps } ;
21
+ const initialProps = await DefaultDocument . getInitialProps ( ctx ) ;
15
22
16
- }
23
+ readColorSchemeFromCookie ( ctx ) ;
17
24
18
- render ( ) {
19
- return (
20
- < Html { ...getColorSchemeHtmlAttributes ( ) } >
21
- < Head />
22
- < body >
23
- < Main />
24
- < NextScript />
25
- </ body >
26
- </ Html >
27
- ) ;
28
- }
25
+ return { ...initialProps } ;
29
26
30
- }
27
+ } ;
You can’t perform that action at this time.
0 commit comments