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
A complete page refresh will lead to next.js rendering twice. The values of router.query are NOT the same between the 2 rendering. The first value is {}, and the second value is the correct one.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
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 30, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Describe the bug
A complete page refresh will lead to next.js rendering twice. The values of
router.query
are NOT the same between the 2 rendering. The first value is {}, and the second value is the correct one.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
{}
and the second one is{a: "b"}
.Expected behavior
router.query
should always be the query string of the url.Screenshots
None.
System information
Additional context
The bug causes failure of the following statement.
The value of
index
will be undefined. The second correct value ofrouter.query.index
would be ignored byReact.useState(...)
.The text was updated successfully, but these errors were encountered: