Match
Route matches represent active route segments in the current navigation, containing their data, status, and metadata.RouteMatch
An individual route match in the current location.string
Unique identifier for this match instance.
string
The ID of the route that was matched.
string
The complete path for this route including parent paths.
string
The actual pathname portion of the URL that matched this route.
Record<string, any>
Path parameters extracted for this match.
'pending' | 'success' | 'error' | 'redirected' | 'notFound'
Current status of the match.
false | 'beforeLoad' | 'loader'
Whether the match is currently fetching data, and which phase.
unknown
Error thrown by the loader or beforeLoad function.
number
Timestamp when the match was last updated.
any
Data returned from the route’s loader function.
Record<string, any>
Combined context from this route and all parent routes.
Record<string, any>
Validated search parameters for this match.
number
The index of this match in the matches array (0 is root).
Match Component
Render a specific route match component.Match Props
string
required
The route ID to match.
RouteComponent
Component to render for the match.
ErrorRouteComponent
Component to render if the match has an error.
RouteComponent
Component to render while the match is pending.
Outlet Component
Render child route matches.useMatches Hook
Access all current route matches.useMatches Options
(matches: RouteMatch[]) => any
Select specific data from the matches.
boolean
Throw error if used outside RouterProvider.Default:
trueuseParentMatches Hook
Access matches for parent routes only.useChildMatches Hook
Access matches for child routes only.useMatch Hook
Access a specific route match with full type safety.useMatch Options
string
The route ID to match. Enables type safety.
boolean
Throw error if route is not matched.Default:
true(match: RouteMatch) => any
Select specific data from the match.
MatchRoute Component
Conditionally render based on route match.MatchRoute Props
string
required
The path to match against.
boolean | Record<string, any>
Match with specific params or any params.
boolean
Match pending routes.
boolean
Use case-sensitive matching.
(match: RouteMatch | false) => ReactNode
Render function receiving the match or false.
useMatchRoute Hook
Programmatically check if a route matches.useMatchRoute Options
string
required
The path to match.
Record<string, any>
Params that must match.
boolean
Check pending matches instead of current matches.
boolean
Use case-sensitive matching.
boolean
Include search params in matching.
boolean
Allow fuzzy matching (match child routes).Default:
true