Routes can be nested inside parent routes through children.
The path of the parent is automatically included in the child, so this config creates both "/dashboard" and "/dashboard/settings" URLs.
Scenario Questions
0-2 years experience
1How would you set up a parent route with a loader and a child route that inherits the parent's data in React Router's data mode?
2If you navigate to '/dashboard/settings' and the parent '/dashboard' route has a loader that fetches user info, what props are available in the Settings component?
2-5 years experience
1We added a nested route '/projects/:projectId/tasks' with its own loader, but the parent '/projects/:projectId' loader is not being called. What could cause this and how would you fix it?
2During a code review you notice that a child route is re-fetching data that the parent already loaded. How would you refactor the route definitions to avoid the duplicate request?
5-8 years experience
1Our application has deep nesting (up to five levels) and each level uses loaders that make network calls. How would you design the routing hierarchy to minimize redundant requests and keep navigation fast?
2Explain the trade‑offs between using route‑level loaders versus a global state management solution like Redux for sharing data across nested routes in a large React app.
8+ years experience
1We are migrating a legacy SPA that uses a custom router to React Router v6 data routers. What architectural considerations and migration steps would you plan to ensure nested routes continue to work and data loading stays consistent?
2In a multi‑team monorepo, some teams need server‑side rendering while others only client‑side. How would you structure nested data routes to support both rendering modes without duplicating route definitions?
Follow-up Questions
What happens if a child route's loader throws an error—how does the parent handle it?
Can you explain how you would test that the nested data loading works as expected?
How would you handle route parameters that need to be shared across multiple nested levels?
Sharethis question
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.