What does nextjs do after router changes?
I saw the theo's last video about under the hood of nextjs.
Realizing after the first html loaded and hydration is done, then everything is like SPA.
This is so clear before I change the route.
In my case, I use a state call isDesktop to render mobile/desktop version of a page which depends on media query(default is false when runs on node)
I use router.push to redirect the page.
When I use desktop, I see a prerender page (mobile version) show up then immediately turn into desktop version.
I just don't know why prerender page still show up, because SPA do not work in this way.
It looks like it redo the html load and hydrates(even though It just download js chunk),but when I open devtools performance panel, there is no second hydration(just another render)
Sorry for my poor english😂, and thank you for your patience
0 Replies