Is there a way to "name/title" a route?
Was about to create a breadcrumb and using "useMatches" to get the route tree. It would be nice to be able to give the route a "title" that I could use in "useMatches" to build the breadcrumb. Is this possible?
2 Replies
genetic-orange•17mo ago
Hi ! You can use static route data (https://tanstack.com/router/v1/docs/framework/react/guide/static-route-data) to do it.
Static Route Data | TanStack Router React Docs
When creating routes, you can optionally specify a staticData property in the route's options. This object can literally contain anything you want as long as it's synchronously available when you create your route.
In addition to being able to access this data from the route itself, you can also access it from any match under the match.staticD...
quickest-silverOP•17mo ago
Thanks! 🙏