3 ms·
I'm curious about restrictions of the next.js router compared to the standard react-router, are there specific serious restrictions you've experienced? I've fo
by chrstphrknwtn 6y ago
I'm curious about restrictions of the next.js router compared to the standard react-router, are there specific serious restrictions you've experienced?
I've found the next router pretty easy to deal with, and have been writing less code to achieve the same things over time as next.js matures.
- dbbk 6y agoNext doesn’t support nested routes and layouts. So if you have, for example, a page that has a a sidebar for a master/detail view, when you load the nested page it blows away the whole DOM and has to render the whole page again, meaning you lose your scroll positions and anything else you want to persist across pages. React Router on the other hand lets you render subroutes directly into an ‘outlet’, maintaining the DOM state outside of it. This is a super common pattern when you’re building something like an admin dashboard app which I do often.