React Router recently made a major shift with the v6 router. There are some key improvements we want to take advantage of. Some of these include:
- More intelligent routing, not relying on the
exact
prop or the order of the route definitions. - Relative routes and linking. No more parent route paths for nested routes.
- New
Outlet
component, allowing us to decide where to render child routes. - Smaller bundle sizes
- Suspense-aware navigation using the new
navigate
function (rather than usinghistory
API in v5) - In the most current versions of React Router, a new set of data-enabled APIs have been added, giving us access to functionality like pre-route loading, route-level form handling, and better route error handling.