Closed henrycatalinismith closed 5 months ago
Very interesting with the "parallel routes" feature. Why is it superior for this feature, compared to just having a layout with the sidebar in it, and then render the children
on the right with whatever filtered content the URL dictates?
This is actually quite a fun question and im going to throw together a little demo project to answer it.
Here you go! Check out https://github.com/henrycatalinismith/next-routing-comparison. The executive summary is that parallel routes are the only way to satisfy all the following constraints:
Building that helped me understand this whole area a lot better. I now see that only the sidebar should be a slot, and the main content should not be nested in a @main
directory, but rather rendered as the plain old children
of the layout,
I made another attempt at this in #103
The work I'm doing in https://github.com/zetkin/lyra/compare/issue-73/translation-page?expand=1 uses a Next 14 feature called parallel routes. So there's currently a Next 14 upgrade buried in that diff, and it seems like an excellent candidate to extract into its own dedicated pull request.