Does the parent layout stay mounted when navigating between children?
Yes. When a child route matches, React Router renders the parent layout and the child inside the Outlet. The parent stays mounted across child navigations, so its state is preserved.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in How to Build Nested Routes and Layouts in React Router
Create a layout component that renders shared UI and an Outlet, define it as the element of a parent route, and nest child routes inside that parent. The matched child renders in the Outlet.
An index route renders at the parent's path when no child route matches. Use it to show a default page, like a dashboard, when the user visits the parent URL directly without going to a specific child.
Yes. An app layout can contain a section layout, which contains page routes, each with their own Outlet. Multi-level nesting lets you build complex, hierarchical UIs cleanly.
Still have questions?
Browse all our FAQs or reach out to our support team
