Replies: 1 comment 1 reply
-
|
you should not use any of those types directly as they are internal. what kind of typesafe helper do you want to write? we have type utilities here: https://tanstack.com/router/latest/docs/framework/react/guide/type-utilities#type-checking-link-options-with-validatelinkoptions |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Our team stumbled upon a bit of confusion when it comes to what type definition to use for what, making very difficult to write type safe helpers. I've noticed that, with version 1.130.12:
routeTree.gen.tsexports three interfaces:FileRoutesByFullPath,FileRoutesById,FileRoutesByTo.FileRoutesByFullPathare thefromoption type inuseNavigate.FileRoutesByIdare thefromoption type inuseParamsanduseSearch.FileRoutesByToare thetooptions type in theLinkcomponent and I assume thenavigatefunction returned byuseNavigate.These observations may or may be not correct of course, they are based upon the inspection of the type definitions, which are not always clear given the complexity of the type inference mechanism of tanstack router.
Could you help us gain a better understanding of what each property means, and why it is used in a specific place? For example, why aren't IDs used everywhere, and instead we have to rely on three enumerations that are slightly different from one another?
Beta Was this translation helpful? Give feedback.
All reactions