A comprehensive, structured guide to mastering React Router DOM v7 β from absolute beginner to production-level pro.
π Official Docs: https://reactrouter.com/home
All topics are organized in numbered folders starting from the most commonly used concepts, progressing to advanced topics.
| # | Folder | Topic | Key APIs |
|---|---|---|---|
| 01 | _01_routers |
Routers | BrowserRouter, HashRouter, MemoryRouter |
| 02 | _02_routes_and_route |
Routes & Route | <Routes>, <Route>, Dynamic Segments, Splats |
| 03 | _03_link_and_navlink |
Link & NavLink | <Link>, <NavLink>, Active States |
| 04 | _04_useNavigate |
useNavigate Hook | Programmatic Navigation, History |
| 05 | _05_useParams |
useParams Hook | URL Parameters, Dynamic Segments |
| 06 | _06_useLocation |
useLocation Hook | Current URL Info, State, Analytics |
| 07 | _07_useSearchParams |
useSearchParams Hook | Query Strings, Filters, Pagination |
| 08 | _08_outlet_and_nested_routes |
Outlet & Nested Routes | <Outlet>, Layout Routes, Nesting |
| 09 | _09_navigate_redirect |
Navigate Component | <Navigate>, Declarative Redirects |
| 10 | _10_useRoutes |
useRoutes Hook | Object-based Route Config |
| # | Folder | Topic | Key APIs |
|---|---|---|---|
| 11 | _11_data_routers |
Data Routers | createBrowserRouter, RouterProvider |
| 12 | _12_loader |
Loaders | loader, Data Fetching Before Render |
| 13 | _13_action |
Actions | action, <Form>, Data Mutations |
| 14 | _14_useLoaderData |
useLoaderData Hook | Access Pre-loaded Data |
| 15 | _15_useActionData |
useActionData Hook | Validation Errors, Action Results |
| 16 | _16_useFetcher |
useFetcher Hook | Non-navigating Data Interactions |
| # | Folder | Topic | Key APIs |
|---|---|---|---|
| 17 | _17_useOutletContext |
useOutletContext Hook | Share Data Between Routes |
| 18 | _18_useMatch |
useMatch Hook | URL Pattern Matching |
| 19 | _19_useRouteError |
useRouteError Hook | Error Handling in Data Routers |
| # | Folder | Topic | Key APIs |
|---|---|---|---|
| 20 | _20_protected_routes |
Protected Routes | Auth Guards, Role-Based Access |
| 21 | _21_error_boundaries |
Error Boundaries | errorElement, 404 Pages |
| 22 | _22_lazy_loading_routes |
Lazy Loading | Code Splitting, React.lazy, lazy |
| # | Folder | Topic | Key APIs |
|---|---|---|---|
| 23 | _23_framework_mode |
Framework Mode | Route Module API, SSR/SSG, RSC |
Build your thought process from absolute beginner to production-level pro. Complexity increases with each project. The final 5 are enterprise-grade inspired by LinkedIn, GitHub, Google Drive, Amazon, and LeetCode.
| # | Project | Concepts Practiced | Link |
|---|---|---|---|
| 01 | Personal Portfolio | BrowserRouter, Routes, NavLink, 404 Page | π use-case.md |
| 02 | Blog Platform | Dynamic Segments :slug, useParams, useNavigate |
π use-case.md |
| 03 | E-Commerce Product Listing | useSearchParams, Filters, Pagination, URL State | π use-case.md |
| # | Project | Concepts Practiced | Link |
|---|---|---|---|
| 04 | Admin Dashboard | Nested Routes, Outlet, Layout Routes, Breadcrumbs | π use-case.md |
| 05 | Authentication Flow | Protected Routes, Guest Routes, Redirect After Login | π use-case.md |
| 06 | Multi-Step Form Wizard | useOutletContext, Nested Steps, Progress Tracking | π use-case.md |
| 07 | Social Media Profile | Tabbed Navigation, Nested Routes, Index Routes | π use-case.md |
| 08 | Documentation Site | Deep Nesting, useRoutes, Dynamic Sidebar, useMatch | π use-case.md |
| # | Project | Concepts Practiced | Link |
|---|---|---|---|
| 09 | E-Commerce Full Store | Data Router, loader, action, useFetcher, Auto-Revalidation | π use-case.md |
| 10 | Project Management Tool | Deep Nested Params, Modal Routes, Background Location | π use-case.md |
| # | Project | Concepts Practiced | Link |
|---|---|---|---|
| 11 | Role-Based SaaS Dashboard | Role Guards, Dynamic Sidebar, 403 Handling | π use-case.md |
| 12 | Real-Time Chat App | Parallel Panels, Thread Routes, useMatch Layout | π use-case.md |
| 13 | CMS with CRUD (Data Router) | Full CRUD, useActionData, useNavigation, useFetcher | π use-case.md |
| 14 | Learning Management System | Course Player, Progress Tracking, Optimistic UI | π use-case.md |
| 15 | Multi-Tenant SaaS | Lazy Loading, Feature Flags, useRouteLoaderData | π use-case.md |
| 16 | Healthcare Patient Portal | Ownership-Based Access, Multi-Portal, Security | π use-case.md |
| # | Project | Concepts Practiced | Link |
|---|---|---|---|
| 17 | Analytics Dashboard | Complex URL Filters, Multi-Value Params, Shareable State | π use-case.md |
| 18 | Enterprise ERP System | 50+ Routes, Modular Architecture, Scalable Config | π use-case.md |
| 19 | Micro-Frontend Architecture | Splat Route Delegation, Module Federation, Cross-App Nav | π use-case.md |
| 20 | Full-Stack Framework Mode | SSR/SSG, Type-Safe Routes, Route Module API, ALL Concepts | π use-case.md |
| # | Project | Inspired By | Key RBAC Concepts | Link |
|---|---|---|---|---|
| 21 | Professional Social Network | Roles (Individual/Recruiter/Company Admin/Premium), Permission Guards, Premium Feature Gating, Modal Routes on Feed, Multi-Portal Architecture | π use-case.md | |
| 22 | Code Collaboration Platform | GitHub | Repo-Level Permissions (Read/Triage/Write/Admin), Org Roles, Splat Routes for File Paths, Tab-Based Routing, Multi-Level Settings | π use-case.md |
| 23 | Cloud Storage & Collaboration | Google Drive | File-Level ACL (Owner/Editor/Viewer), Shared Drive Roles, Folder Navigation, Access Request Flow, Context Menu Actions | π use-case.md |
| 24 | Full E-Commerce Marketplace | Amazon/Flipkart | Three Portals (Buyer/Seller/Admin), Seller Approval Workflow, Premium Seller Gating, 10+ URL Filters, Return/Refund Flows | π use-case.md |
| 25 | Competitive Coding Platform | LeetCode/HackerRank | Content-Level Premium Gating, Time-Gated Contest Routes, Problem Setter/Organizer Portals, Workspace Split View, Submission Fetcher | π use-case.md |
React Router v7 supports 3 modes:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React Router v7 Modes β
ββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββββββββββββ€
β Declarative β Data β Framework β
β (Simple) β (Powerful) β (Full Featured) β
ββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββββββββββββ€
β BrowserRouterβ createBrowser β Vite Plugin + β
β <Routes> β Router β createBrowserRouter β
β <Route> β RouterProvider β routes.ts β
β <Link> β loader / action β Type-safe Route Module API β
β useNavigate β useFetcher β SSR / SSG / SPA β
β useParams β errorElement β Auto Code Splitting β
β useLocation β lazy loading β Meta / Links / Headers β
ββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββββββββββββββ
| Hook | Purpose | Mode |
|---|---|---|
useNavigate |
Programmatic navigation | All |
useParams |
URL parameters | All |
useLocation |
Current URL info | All |
useSearchParams |
Query string management | All |
useOutletContext |
Parent β Child data | All |
useMatch |
URL pattern matching | All |
useRoutes |
Object-based routing | All |
useLoaderData |
Route loader data | Data + Framework |
useActionData |
Route action results | Data + Framework |
useFetcher |
Non-navigating mutations | Data + Framework |
useRouteError |
Route error info | Data + Framework |
useNavigation |
Navigation state | Data + Framework |
useRouteLoaderData |
Any route's loader data | Data + Framework |
| Component | Purpose | Mode |
|---|---|---|
<BrowserRouter> |
App wrapper (Declarative) | Declarative |
<RouterProvider> |
App wrapper (Data) | Data + Framework |
<Routes> |
Route container | Declarative |
<Route> |
Define a route | Declarative |
<Link> |
Navigation link | All |
<NavLink> |
Navigation with active state | All |
<Navigate> |
Declarative redirect | All |
<Outlet> |
Render child routes | All |
<Form> |
Data-aware form | Data + Framework |
Phase 1: Declarative Mode Fundamentals (Folders 01β10)
βββ Master basic routing, navigation, and core hooks
βββ Build Projects 01β03 (Portfolio, Blog, E-Commerce Listing)
βββ π― Goal: Comfortable with basic SPA routing
Phase 2: Intermediate Patterns (Folders 08, 17, 18, 20)
βββ Master nested routes, layouts, and auth patterns
βββ Build Projects 04β08 (Dashboard, Auth, Wizard, Profile, Docs)
βββ π― Goal: Build any multi-page app with confidence
Phase 3: Data Mode APIs (Folders 11β16, 19, 21)
βββ Master loaders, actions, fetchers, and error handling
βββ Build Projects 09β13 (E-Commerce, PM Tool, SaaS, Chat, CMS)
βββ π― Goal: Build data-driven apps with the modern approach
Phase 4: Production & Expert Patterns (Folders 20β23)
βββ Master lazy loading, multi-tenant, and framework mode
βββ Build Projects 14β20 (LMS, Multi-Tenant, ERP, Micro-FE, Full-Stack)
βββ π― Goal: Architect production-grade applications
Phase 5: Enterprise RBAC & Real-World Mastery (Projects 21β25) π₯
βββ Master RBAC, permission-based access, multi-portal architecture
βββ Build LinkedIn, GitHub, Google Drive, Amazon, LeetCode clones
βββ Learn granular permissions (file/repo/content-level), premium gating
βββ Master time-gated routes, approval workflows, multi-team routing
βββ π― Goal: Architect ANY web application at ANY scale β YOU ARE A PRO!
# Create a new React project with Vite
npm create vite@latest my-router-app -- --template react
# Install React Router
cd my-router-app
npm install react-router
# Start dev server
npm run devAshutosh Kumar β Mastering React Router DOM systematically! π
Made with β€οΈ for structured learning. Each folder contains a detailed README with explanations, code examples, comparison tables, and key takeaways. The project practice section builds your thought process from absolute beginner to production-level expert.