News for hackers. Stuff that matters.
Re:Create React App 4.0 by chrstphrknwtn on Saturday October 24, 2020 @02:35AM (#24877396)
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.

Re:Create React App 4.0 by dbbk on Saturday October 24, 2020 @06:33AM (#24878261)
Next 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.