Skip to content
New issue

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

fix(examples): pageProps is {} by default #2763

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -5,7 +5,7 @@ import { trpc } from 'utils/trpc';

const MyApp: AppType = ({ Component, pageProps }) => {
return (
<SessionProvider session={pageProps.session}>
<SessionProvider session={(pageProps as any).session}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to fix this without any

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KATT Only if we create a type for it. But this is not intended behavior. next@12.3.1 fixes this. Do I just bump the version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we likely need to bump the version on next and next-auth

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be

const MyApp: AppType<{ session: Session | null }> = ({ Component, pageProps }) => ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try bumping the version and if it doesn't work already I will add the type. Is that ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Julius says above is probably right -- I didn't look into why it started failing, I just noted the issue down

<Component {...pageProps} />
</SessionProvider>
);
Expand Down