We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using ni18n with next-auth and after I added session to my props
interface MyAppProps extends AppProps<{ session: Session }> { emotionCache?: EmotionCache; } const MyApp: React.FunctionComponent<MyAppProps> = (props) => { const { Component, emotionCache = clientSideEmotionCache, pageProps: { session, ...pageProps } } = props;
I started getting this type error in appWithI18Next
export default appWithI18Next/*<{ session: Session }>*/(MyApp, ni18nConfig);
TS2345: Argument of type 'FunctionComponent' is not assignable to parameter of type 'ElementType<AppInitialProps<{}> & { Component: NextComponentType<NextPageContext, any, any>; router: Router; __N_SSG?: boolean | undefined; __N_SSP?: boolean | undefined; __N_RSC?: boolean | undefined; } & { ...; }>'. Type 'FunctionComponent' is not assignable to type 'FunctionComponent<AppInitialProps<{}> & { Component: NextComponentType<NextPageContext, any, any>; router: Router; __N_SSG?: boolean | undefined; __N_SSP?: boolean | undefined; __N_RSC?: boolean | undefined; } & { ...; }>'. Types of parameters 'props' and 'props' are incompatible. Type 'AppInitialProps<{}> & { Component: NextComponentType<NextPageContext, any, any>; router: Router; __N_SSG?: boolean | undefined; __N_SSP?: boolean | undefined; __N_RSC?: boolean | undefined; } & { ...; }' is not assignable to type 'MyAppProps'.
When I extended it with generic like this
declare const appWithI18Next: <T>(WrappedComponent: ElementType<AppProps<T> & { children?: ReactNode; }>, options: Ni18nOptions) => ElementType;
error disappeared
I'm not sure if it's working, still finishing adding next-auth
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm using ni18n with next-auth and after I added session to my props
I started getting this type error in appWithI18Next
TS2345: Argument of type 'FunctionComponent' is not assignable to parameter of type 'ElementType<AppInitialProps<{}> & { Component: NextComponentType<NextPageContext, any, any>; router: Router; __N_SSG?: boolean | undefined; __N_SSP?: boolean | undefined; __N_RSC?: boolean | undefined; } & { ...; }>'. Type 'FunctionComponent' is not assignable to type 'FunctionComponent<AppInitialProps<{}> & { Component: NextComponentType<NextPageContext, any, any>; router: Router; __N_SSG?: boolean | undefined; __N_SSP?: boolean | undefined; __N_RSC?: boolean | undefined; } & { ...; }>'. Types of parameters 'props' and 'props' are incompatible. Type 'AppInitialProps<{}> & { Component: NextComponentType<NextPageContext, any, any>; router: Router; __N_SSG?: boolean | undefined; __N_SSP?: boolean | undefined; __N_RSC?: boolean | undefined; } & { ...; }' is not assignable to type 'MyAppProps'.
When I extended it with generic like this
error disappeared
I'm not sure if it's working, still finishing adding next-auth
The text was updated successfully, but these errors were encountered: