T
TanStack2y ago
sharp-indigo

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
subsequent-cyan
subsequent-cyan2y ago
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...
sharp-indigo
sharp-indigoOP2y ago
Thanks! 🙏

Did you find this page helpful?