-
Notifications
You must be signed in to change notification settings - Fork 405
Closed
Description
Inspired by Remix's export meta feature: https://remix.run/docs/en/v1/route/meta
Essentially you can export a meta function from route components, and then higher up in the component tree use useMatches to get all of the matching meta functions and use the data.
Two example use cases come to mind:
- Breadcrumbs (example on this page). Route component files can return
titleandhrefproperties from theirmetafunctions. A parent component can get all of these results and render breadcrumbs. - Shared layout titles. Similar to breadcrumbs, basically just getting a title for whatever is being rendered inside of
<Outlet />and rendering it in a consistent way for all child routes.
stefanprobst
Metadata
Metadata
Assignees
Labels
No labels