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
Perform client-side navigation by pressing one of the page hyperlinks.
Watch the console for multiple SHOULD ONLY MOUNT 1 TIME! logs as it does a full reload instead of client-side rendering.
Describe the Bug
The setup is simple. I have a layout under a dynamic route. Inside of it is a memoized client component that does not take in props.
The pages and rendered using generateStaticParams to parse the language for the page to make is SSG.
However, running client-side rendering on these pages forces a full reload, as seen from the client side, which keeps on remounting.
This effect is devastating in real projects as all my global states and variables are destroyed when still navigating under the same layout parent.
This happens on a production build.
Expected Behavior
Using client-side navigation, Link from next/link or router.push from next/navigation, should never force a full reload on the Layout if the target path is a local path even when they are SSG pages using generateStaticParams.
Which browser are you using? (if relevant)
Chrome Version 115.0.5790.171 (Official Build) (64-bit)
How are you deploying your application? (if relevant)
Vercel
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.
This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router
Link to the code that reproduces this issue or a replay of the bug
https://github.com/WilsonPhooYK/nextjs-routing
To Reproduce
SHOULD ONLY MOUNT 1 TIME!
logs as it does a full reload instead of client-side rendering.Describe the Bug
The setup is simple. I have a layout under a dynamic route. Inside of it is a memoized client component that does not take in props.


The pages and rendered using generateStaticParams to parse the language for the page to make is SSG.

However, running client-side rendering on these pages forces a full reload, as seen from the client side, which keeps on remounting.

This effect is devastating in real projects as all my global states and variables are destroyed when still navigating under the same layout parent.
This happens on a production build.
Expected Behavior
Using client-side navigation,
Link
fromnext/link
orrouter.push
fromnext/navigation
, should never force a full reload on theLayout
if the target path is a local path even when they are SSG pages usinggenerateStaticParams
.Which browser are you using? (if relevant)
Chrome Version 115.0.5790.171 (Official Build) (64-bit)
How are you deploying your application? (if relevant)
Vercel
The text was updated successfully, but these errors were encountered: