Nested routes dùng <Outlet /> component để render child routes.
- Parent route render layout, Outlet là nơi child route render:
<Route path='/dashboard' element={<DashboardLayout />}><Route index element={<Overview />} /><Route path='settings' element={<Settings />} /></Route>. - Child route paths relative, không cần lặp lại parent path.
Nested routes use the <Outlet /> component as a slot where child routes render.
- The parent route renders the shared layout and Outlet marks where the child content appears:
<Route path='/dashboard' element={<DashboardLayout />}><Route index element={<Overview />} /><Route path='settings' element={<Settings />} /></Route>. - Child route paths are relative — no need to repeat the parent path.