3 ms·
It's really disappointing that Next continues to push forward with all these innovations that I'd love to take advantage of, but can't for the single reason tha
by dbbk 7y ago
It's really disappointing that Next continues to push forward with all these innovations that I'd love to take advantage of, but can't for the single reason that it doesn't support nested layouts or routing. Every page transition requires blowing up the entire layout, you can't have a persistent header for example. And there's no way (that I've found yet) to build any kind of skeleton loading screen during transitions.
This is a really basic issue that negates all the good they've got and it's frustrating.
- 9935c101ab17a66 7y agoHave you looked at this: https://nextjs.org/docs/advanced-features/custom-app https://nextjs.org/docs/advanced-features/custom-app Not sure if it exactly allievates the problem you face, but that's where I ended up when trying to share layouts in a sensible fashion.
- SirensOfTitan 7y agoI wrote a little naive hook for pulling this off in our app: https://gist.github.com/SirensOfTitan/6067c1c1aa7912873615780ee519c74b https://gist.github.com/SirensOfTitan/6067c1c1aa791287361578... ...essentially we listen for route changes in our top level layouts using that hook to coordinate which parts of the page to keep active and which to show spinners on. I’d imagine there are more robust ways to do this too: I think I saw a plug-in that uses element ids to figure out how to morph the page.