Which project does this relate to?#
Router
Describe the bug#
The documentation for router.matchRoute is inconsistent and confusing about what the method actually returns.
- At the top of the doc, it says the method returns a matched route’s params or
false.
- At the bottom of the doc, it says it returns a RouteMatch object or
false.
- In actual usage,
router.matchRoute() returns only the params, not a RouteMatch object.
This mismatch can cause confusion, especially since:
useMatchRoute() also returns params | false (correctly documented)
router.matchRoutes() returns an array of full RouteMatch objects
It’s unclear whether the return type or the implementation is intended behavior — but either way, the docs should be aligned with the actual return.
In my case, I wanted to use router.matchRoute() in a child loader to access a grandparent route's loaderData, but since it only returns params, it's not possible. I'd expect router.matchRoute() to return a full RouteMatch object to allow more control and consistency across the API.
Your Example Website or App#
/
Steps to Reproduce the Bug or Issue#
Not applicable — this is a documentation inconsistency, not a runtime bug.
Expected behavior#
I would expect router.matchRoute() to return a full RouteMatch object (or false), as suggested in the lower part of the documentation.
This would provide consistency with .matchRoutes(), and allow use cases like accessing loaderData from grandparent routes — without having to manually walk through .matchRoutes() results.
Screenshots or Videos#

Platform#
N/A
Additional context#
No response
yeah the docs are outdated here.
matchRoutedoes indeed not return aRouteMatch. feel free to create a PR to the docs