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";
44
55const { readColorSchemeFromCookie, getColorSchemeHtmlAttributes } = getColorSchemeSsrUtils ( ) ;
66
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+ }
1118
12- readColorSchemeFromCookie ( ctx ) ;
19+ Document . getInitialProps = async ( ctx : DocumentContext ) => {
1320
14- return { ... initialProps } ;
21+ const initialProps = await DefaultDocument . getInitialProps ( ctx ) ;
1522
16- }
23+ readColorSchemeFromCookie ( ctx ) ;
1724
18- render ( ) {
19- return (
20- < Html { ...getColorSchemeHtmlAttributes ( ) } >
21- < Head />
22- < body >
23- < Main />
24- < NextScript />
25- </ body >
26- </ Html >
27- ) ;
28- }
25+ return { ...initialProps } ;
2926
30- }
27+ } ;
You can’t perform that action at this time.
0 commit comments