diff --git a/packages/client/src/pages/_app.tsx b/packages/client/src/pages/_app.tsx index 2e5c1f4f..64fde0b1 100644 --- a/packages/client/src/pages/_app.tsx +++ b/packages/client/src/pages/_app.tsx @@ -6,60 +6,68 @@ import 'tiptap/core/styles/index.scss'; import { isMobile } from 'helpers/env'; import { IsOnMobile } from 'hooks/use-on-mobile'; import { Theme } from 'hooks/use-theme'; -import type { AppProps } from 'next/app'; +import App from 'next/app'; import Head from 'next/head'; import React from 'react'; -type P = AppProps<{ isMobile?: boolean }>; +class MyApp extends App<{ isMobile: boolean }, unknown> { + state = { + locale: '', + user: null, + }; -function MyApp(props: AppProps & { isMobile?: boolean }) { - const { Component, pageProps, isMobile } = props; + static getInitialProps = async ({ Component, ctx }) => { + const request = ctx?.req; + const getPagePropsPromise = Component.getInitialProps ? Component.getInitialProps(ctx) : Promise.resolve({}); + const [pageProps] = await Promise.all([getPagePropsPromise]); - return ( - <> -
- - - - - - - - - - - - - - - - - - - - - {((process.env.DNS_PREFETCH || []) as string[]).map((url) => ( - - ))} - -