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
On the next docs for getServerSideProps the query key from context is defined as of type string. As far as I can tell this is incorrect, based on this definition the correct type definition seems to be
[key: string]: string |string[]|undefined;
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Create a new Next.js app npx create-next-app .
Create a new page with getServerSideProps and log context.query
Visit the page you created with query params ex: localhost:3000/page?test=hello
Observe that context.query is an object and not a string
Expected behavior
Docs to have the correct type
Screenshots
If applicable, add screenshots to help explain your problem.
System information (not applicable)
OS: [e.g. macOS, Windows]
Browser (if applies) [e.g. chrome, safari]
Version of Next.js: [e.g. 10.0.1]
Version of Node.js: [e.g. 12.0.0]
Deployment: [e.g. next start, next export, Vercel, other platform]
Additional context
I'm new to TS so I hope I haven't missed something obvious
The text was updated successfully, but these errors were encountered:
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 28, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
On the next docs for getServerSideProps the
query
key fromcontext
is defined as of type string. As far as I can tell this is incorrect, based on this definition the correct type definition seems to beTo Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
npx create-next-app .
context.query
localhost:3000/page?test=hello
Expected behavior
Docs to have the correct type
Screenshots
If applicable, add screenshots to help explain your problem.
System information (not applicable)
Additional context
I'm new to TS so I hope I haven't missed something obvious
The text was updated successfully, but these errors were encountered: