Returns an array of all matched routes from the root layout down to the current page. Each match includes the route’s loader data, params, and route ID.
This is useful for:
A common use case is accessing a layout’s loader data from a page component:
Layouts can access their child page’s loader data to render things like a table of contents:
app/docs/_layout.tsx
Each match in the array has this shape:
Find a specific route’s match by its route ID:
Returns undefined if the route is not in the current match list.
Get the current page’s match (the last/deepest match):
Edit this page on GitHub.