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
Press the Shallow routing button and observe how page reloads after shallow routing.
CleanShot.2023-02-13.at.22.05.26.mp4
Describe the Bug
Shallow routing should not initiate a page reload. On a small demo, like the reproduction demo, it’s barely perceptible, but on a larger site, it’s very much noticeable (see video below).
CleanShot.2023-02-13.at.22.10.23.mp4
Expected Behavior
The page shouldn’t reload on shallow routing.
Note: this issue was originally posted in vercel/platforms#202, but posting here because it appears to be a core issue related to next/router.
Which browser are you using? (if relevant)
Chrome 109.0.5414.119
How are you deploying your application? (if relevant)
localhost
The text was updated successfully, but these errors were encountered:
@SuttonJack man... you just saved me so much time with your comment... that was indeed it. Hope it helps someone else, too, if they see this solution. Thank you! 💯🙏
Leaving solution here, in case I ever delete my reproduction.
constrouter=useRouter()const{query: { site }, pathname }=routerreturn(<buttononClick={()=>{router.push({ pathname,query: { site,hello: 'world'}},{pathname: '/',query: {hello: 'world'}},// ← need this too for shallow routing on subdomains{shallow: true})}}>
Shallow routing
</button>)
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://github.com/heymartinadams/next-router-subdomains
To Reproduce
yarn next
http://a.localhost:3000
CleanShot.2023-02-13.at.22.05.26.mp4
Describe the Bug
Shallow routing should not initiate a page reload. On a small demo, like the reproduction demo, it’s barely perceptible, but on a larger site, it’s very much noticeable (see video below).
CleanShot.2023-02-13.at.22.10.23.mp4
Expected Behavior
The page shouldn’t reload on shallow routing.
Note: this issue was originally posted in vercel/platforms#202, but posting here because it appears to be a core issue related to
next/router
.Which browser are you using? (if relevant)
Chrome 109.0.5414.119
How are you deploying your application? (if relevant)
localhost
The text was updated successfully, but these errors were encountered: