Sarath KrishnanAug. 26, 2025
When building modern React applications, navigation is essential. That’s where routing comes in — it allows you to move between pages or views seamlessly. The most popular solution for this is React Router, and with version 6, it introduces a cleaner API, improved performance, and a host of new features.
In this blog, we’ll break down everything you need to know about React Router v6: its improvements, how to get started, and practical examples.
React Router is a client-side routing library for React. It maps URLs to components, so users can navigate your app without triggering a full page reload. This makes React apps feel smooth, fast, and app-like.
React Router v6 brings several significant changes compared to v5:
Install React Router with:
Wrap your app with BrowserRouter in index.js:
In v6, we now use <Routes> instead of <Switch>:
Nested routing is much simpler and more powerful:
Inside Dashboard, use the <Outlet /> component to render nested routes:
In v6, useNavigate replaces useHistory:
Dynamic routes are straightforward using useParams:
React Router v6 allows easy 404 handling with a wildcard route:
React Router v6 is a big step forward in managing routing for React apps. With its simplified syntax, enhanced nesting, and hooks-based approach, it makes building scalable navigation systems easier than ever.
If you’re still on v5, upgrading to v6 is highly recommended to take advantage of its performance improvements and developer-friendly features.
0