Type Declaration
Props
Nested
<Route> elements that define the route configuration.The Location to match against. Defaults to the current location. This is useful for testing or when you want to render routes based on a different location.
Example
Basic Usage
Nested Routes
No Match (404)
Multiple Route Sets
Behavior
- Renders the first
<Route>that matches the current location - Uses a ranking system to determine the best match when multiple routes could match
- Returns
nullif no routes match - Static routes (no params) rank higher than dynamic routes (
:id) - Routes with more segments rank higher than routes with fewer segments
Notes
- In most modern apps, you’ll use
createBrowserRouterinstead for data loading, actions, and other advanced features - Routes are matched relative to their parent route’s path
- The
*wildcard can be used to match any remaining path segments