Skip to content

Conversation

@harikapadia999
Copy link

Description

Fixes #42846

The AppType generic parameter P was incorrectly used as InitialProps instead of PageProps. This fix properly uses AppInitialProps<PageProps> for the InitialProps parameter to match the actual structure where pageProps is wrapped in an object.

Changes

Before:

export type AppType<P = {}> = NextComponentType<
  AppContextType,
  P,
  AppPropsType<any, P>
>

After:

export type AppType<PageProps = {}> = NextComponentType<
  AppContextType,
  AppInitialProps<PageProps>,
  AppPropsType<any, PageProps>
>

Why This Fix?

According to NextComponentType definition:

  • 1st param: Context
  • 2nd param: InitialProps (should be AppInitialProps<PageProps>)
  • 3rd param: Props (already correctly using AppPropsType<any, PageProps>)

The parameter name is also changed from P to PageProps for clarity.

Testing

  • TypeScript compilation passes
  • Type definitions now correctly reflect the actual structure

The AppType generic parameter P was incorrectly used as InitialProps
instead of PageProps. This fix properly uses AppInitialProps<PageProps>
for the InitialProps parameter to match the actual structure where
pageProps is wrapped in an object.

Fixes vercel#42846
@nextjs-bot
Copy link
Collaborator

Allow CI Workflow Run

  • approve CI run for commit: e32c060

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter on AppType is used incorrectly

2 participants