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
If I remove the GetStaticProps definition on the first line, things work as expected. I assume that's because I could specify the props type as a type argument to GetStaticProps<{ hello: string }>, but I don't want that.
Is this even possible to fix?
Expected Behavior
Would love for this to just propagate the props as expected.
To Reproduce
Create a new Next.js project with TypeScript, and create a new pages file (index.tsx) for example. Paste the following code:
That's true – and what I ended up doing as a workaround – but I prefer using the function type, so I don't have to specify both the arguments and the return values separately
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 27, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
11.0.1
What version of Node.js are you using?
16.9.1
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
Props are not being inferred correctly by InferGetStaticPropsType in the following case:
If I remove the
GetStaticProps
definition on the first line, things work as expected. I assume that's because I could specify the props type as a type argument toGetStaticProps<{ hello: string }>
, but I don't want that.Is this even possible to fix?
Expected Behavior
Would love for this to just propagate the props as expected.
To Reproduce
Create a new Next.js project with TypeScript, and create a new pages file (index.tsx) for example. Paste the following code:
The text was updated successfully, but these errors were encountered: