Skip to content

Commit 1f01e9b

Browse files
committed
next integration: enable composition
1 parent 9c84456 commit 1f01e9b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/next.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,13 @@ export function withAppDsfr<AppComponent extends NextComponentType<any, any, any
175175
);
176176

177177
$overwriteGetInitialProps.current = () => {
178+
const super_getInitialProps =
179+
(AppWithDsfr as any).getInitialProps.bind(AppWithDsfr) ??
180+
App.getInitialProps?.bind(App) ??
181+
DefaultApp.getInitialProps.bind(DefaultApp);
182+
178183
(AppWithDsfr as any).getInitialProps = async (appContext: AppContext) => {
179-
const initialProps = await (App.getInitialProps ?? DefaultApp.getInitialProps)(
180-
appContext
181-
);
184+
const initialProps = await super_getInitialProps(appContext);
182185

183186
if (!isBrowser) {
184187
$colorScheme.current =

0 commit comments

Comments
 (0)