Replies: 1 comment
-
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.
0 replies
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.ts
exports three interfaces:FileRoutesByFullPath
,FileRoutesById
,FileRoutesByTo
.FileRoutesByFullPath
are thefrom
option type inuseNavigate
.FileRoutesById
are thefrom
option type inuseParams
anduseSearch
.FileRoutesByTo
are theto
options type in theLink
component and I assume thenavigate
function 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