React Router Declarative Mode
Declarative mode is React Router's simplest mode using <BrowserRouter>, <Routes>, and <Route> for basic client-side routing without data loading features like loaders or actions.
When to Apply
- Using
<BrowserRouter>for routing - Configuring routes with
<Routes>and<Route> - Navigating with
<Link>,<NavLink>, oruseNavigate - Reading URL params with
useParams - Working with search params using
useSearchParams - Accessing location with
useLocation
References
Load the relevant reference for detailed guidance on the specific API/concept:
Critical Patterns
These are the most important patterns to follow. Load the relevant reference for full details.
Basic Route Setup
Configure routes with JSX using <Routes> and <Route>:
NavLink Active States
Use NavLink for navigation with active styling:
Reading URL Params
Use useParams to read dynamic route segments:
Working with Search Params
Use useSearchParams for query string values:
Further Documentation
If anything related to React Router is not covered in these references, you can search the official documentation:


