Is there a exported type that returns all available absolute routes?
Hi!
I have this example where i have an array of objects used for a long list of links:
Currently href has the string type assigned but is there a type that i can assign it that returns all available absolute routes?
3 Replies
rare-sapphire•17mo ago
You'd have to pass in the necessary generics, but the
ToPathOption
type should work for you.
Heres the source for it: https://github.com/TanStack/router/blob/a4a5b5e56879c7e27107bc9ac6408ce7c15207a6/packages/react-router/src/link.tsx#L391
You'd have to call it as such:
GitHub
router/packages/react-router/src/link.tsx at a4a5b5e56879c7e27107bc...
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
sensitive-blueOP•17mo ago
Thanks!
rising-crimson•16mo ago
What did you end up using?
Are these still necessary?