Navigation for Reacts
Navigation in a React app is client-side routing, where a router such as React Router maps URLs to components without full page reloads. It covers nested routes, URL parameters, redirects and protected routes, which together make up authentication flows like login, token storage and guarded pages.
Stage: Data and Routing · Part of the React roadmap · Last reviewed 19 November 2026
What to learn in Navigation
- Define routes and nested layouts with React Router
- Read URL parameters and query strings inside a component
- Navigate programmatically after a form submit
- Protect a route by redirecting unauthenticated users to login
- Store and refresh auth tokens with safe practices
- Handle not-found and error routes
Navigation interview questions
How does client-side routing differ from normal page navigation?
The router intercepts link clicks, updates the URL with the History API and renders the matching component without requesting a new HTML page. This keeps app state and is faster, but the server must still serve the app for deep links.
Where should an authentication token be stored in a React app?
Avoid localStorage for sensitive tokens because scripts can read it during an XSS attack. An HttpOnly, Secure cookie set by the server is safer, since JavaScript cannot access it. Pair it with CSRF protection and short expiry.
Where Navigation fits in the React roadmap
Navigation belongs to the Data and Routing stage (intermediate level), which takes about 25 hours. Connect to the world.
Other units in this stage
Back to the full React roadmap