You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.
мой код _document.tsx содержит определенную кастомизацию и выглядит так
importcxfrom'clsx';import{DocumentInitialProps}from'next/dist/next-server/lib/utils';importDocument,{DocumentContext,DocumentProps,Head,Main,NextScript}from'next/document';importReactfrom'react';import{DEFAULT_LOCALE}from'@i18n/i18n';import{withFork}from'@lib/effector-next';/** * Additional props depending on our App * * Must be returned by getInitialProps and will be available in render function */typeProps={locale: string;lang: string;};typeDocumentGetInitialPropsOutput=Props&DocumentInitialProps;typeDocumentRenderProps=Props&DocumentProps;/** * XXX Is only rendered on the server side and not on the client side * * Used to inject <html lang=""> tag * * See https://github.com/zeit/next.js/#custom-document */classAppDocumentextendsDocument<DocumentRenderProps>{// `Document's getInitialProps function is not called during client-side transitions, nor when a page is statically optimized`staticasyncgetInitialProps(ctx: DocumentContext): Promise<DocumentGetInitialPropsOutput>{constinitialProps: DocumentInitialProps=awaitDocument.getInitialProps(ctx);const{ query }=ctx;consthasLocaleFromUrl=!!query?.locale;constlocale: string=hasLocaleFromUrl ? (query?.localeasstring) : DEFAULT_LOCALE;// If the locale isn't found (e.g: 404 page)constlang: string=locale.split('-')?.[0];return{
...initialProps,
locale,
lang,};}render(): JSX.Element{const{ lang, locale }: DocumentRenderProps=this.props;return(<htmllang={lang}><Head/><bodyclassName={cx(`locale-${locale}`,`lang-${lang}`)}><Main/><NextScript/></body></html>);}}// To load the initial state on the server, we attached withFork wrapper to _document componentconstenhance=withFork({debug: false});exportdefaultenhance(AppDocument);
Новая версия содержащая измененный with-fork не работает так как судя по всему ожидает "чистый" Document.
Выдает такие ошибки
The text was updated successfully, but these errors were encountered:
мой код _document.tsx содержит определенную кастомизацию и выглядит так
Новая версия содержащая измененный with-fork не работает так как судя по всему ожидает "чистый" Document.
Выдает такие ошибки
The text was updated successfully, but these errors were encountered: