What are nested routes and layout routes?
Model answer
Nested routes put child routes inside a parent route, and the parent renders <Outlet /> where the child appears. A layout route has no path of its own and just wraps children with shared UI such as a navbar or sidebar.
It avoids repeating layout code and lets the layout stay mounted while the page changes.
Learn this topic
React Router: Multiple Pages, Links, Params, Layouts and Protected Routes in the course React.js Full Course: Beginner to Advanced.
Sign in to add your own answer.