Skip to content

[fix] Correct AppType generic prop handling #78378

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

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

ash2228
Copy link

@ash2228 ash2228 commented Apr 21, 2025

Fixes [#44434] (#44434)

Problem

  • AppType<P> incorrectly applied P to pageProps instead of root props
  • Type checking didn't match runtime behavior

Solution

Modified AppType definition in utils.ts to:

export type AppType<P = {}> = NextComponentType<
  AppContextType,
  P & { pageProps?: any },
  AppPropsType<Router, P>
>

@ijjk
Copy link
Member

ijjk commented Apr 21, 2025

Allow CI Workflow Run

  • approve CI run for commit: be0a7e5

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

@ash2228
Copy link
Author

ash2228 commented Apr 21, 2025

This is my first contribution. I've:

  • Fixed the AppType typing issue
  • Added test coverage
  • Verified the core functionality works locally

The CI failures appear unrelated to my changes. Could you:

  1. Confirm if these are known environment issues?
  2. Suggest how I can help resolve them?

@ash2228
Copy link
Author

ash2228 commented Apr 21, 2025

@ijjk Thanks for the review!

  • Confirmed the type fix works locally
  • Tests pass as shown in the reproduction
  • Ready for CI approval when convenient

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.

2 participants