TanStackT
TanStack2y ago
7 replies
sacred-rose

Matches after route Param

Hello! I have a simple file based route layout with a parameter for a venue slug (TSR 1.48.1):
routes/ venues/ $venueId/ index.tsx reviews.tsx

when I access /venues/venue-slug/reviews The devtools and output of useMatches has the following
__root__ / /venues /venues/venue-slug/reviews

Would I be incorrect to assume that there should be this structure in the Matches list?:
__root__ / /venues /venues/venue-slug (or venues/$venueId) /venues/venue-slug/reviews

I'm trying to use the meta set for each part of the route (in RouteOptions) to build breadcrumbs, but anything after the $venueId param seems to be squashed in to a single match. Is there a way of achieving this using file based routing? Thank you for looking!
Was this page helpful?