S
SolidJS2mo ago
sh03

Difference between a nested route layout and just wrapping a route with a <Layout> component

Is there a practical difference between declaring a nested route layout like this: https://docs.solidjs.com/solid-start/building-your-application/routing#nested-layouts and just wrapping a route with a <Layout> component?
2 Replies
Brendonovich
Brendonovich2mo ago
One difference is that the layout will only be mounted once with the nested route layout while you're navigating around underneath that layout. It'll unmount when you go to a route outside it. Wrapping each route with <Layout> will recreate the layout on each navigation
sh03
sh03OP2mo ago
I see, thanks 👍

Did you find this page helpful?