React Router
Harry
· 22 Sep 2026
· 1 views
Log in to track your progress and mark lessons complete.
Sponsored
Setup
npm install react-router-domRoutes and Navigation
Map URLs to components with Routes and Route; navigate with Link, NavLink and useNavigate.
Params and Nesting
Read :id with useParams, ?q= with useSearchParams, and render child routes through Outlet.
Guards and Splitting
Wrap routes in a Protected component that redirects without a token; lazy-load heavy routes with Suspense; add a * 404 route last.
Key Points
- Router maps URL to component with no reload.
- NavLink tracks active state.
- Split by route for smaller bundles.