0
Challenge · 43Routing & Data

Nested Routes

Coreused in ~80% of apps

Real apps share a shell — a navbar, a sidebar, a dashboard frame — across many pages. Nested routes let a parent render that shell ONCE and let child pages swap inside it, instead of re-pasting the layout into every screen.

Core idea. A parent route renders shared layout plus an <Outlet /> placeholder; its child routes render INTO that outlet. The parent stays mounted while children swap, so the shell (and its state) survives navigation.
Playground, this isn't a screenshot
URL
myapp.com/dashboard/overview
<DashboardLayout />mounted once · never unmounts
Shell state (kept alive): 0
<Outlet />child remounted
128
Posts
4.2k
Likes
19k
Views
URL = /dashboard/overview → the Overview child renders inside <Outlet />.

Bump the shell counter, then switch tabs — it never resets, because the parent route stays mounted while children swap into <Outlet />.

↑ play a little first, then dig in