when using getRouteApi in a component outside of the file where createFileRoute
is used, typing is not working.
#4071
Unanswered
alex-collibra
asked this question in
Q&A
Replies: 1 comment
-
probably just a stackblitz issue? works fine locally ![]() |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Check the
simple-route_/$id.tsx
in the below stackblitz.https://stackblitz.com/edit/tanstack-router-r54t3ctf?file=src%2Fcomponents%2FSimpleRoute.tsx
As soon as I move
RouteComponent
outside of the file wherecreateFileRoute
is called, types forgetRouteApi().useParams()
are broken (typed as any.Not sure if this is expected and is a limitation or if this is a bug.
In case this is expected, is there a good way to type params yourself? (like providing a generic type for useParams())
Any help is much appreciated 🙏
Beta Was this translation helpful? Give feedback.
All reactions