Helper types for router #1101
antonio-ivanovski
started this conversation in
Ideas
Replies: 1 comment
-
I have the same question. Did you ever find a solution? I asked something similar here. |
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.
-
In the past, I have used
RouteApi<'my-route/path/$someId'>
to injectrouteApi
in some component or external method. This came very handy when there were components that were shared by multiple routes (for exampleblog/posts/$postId/edit
andblog/posts/add
). Currently theRouteApi
is deprecated so I resort to usingReturnType<typeof getRouteApi<'....
. Using this is very long and noisy.Propose that there are types for most of the concepts in the router, as mentioned above for
RouteApi
but also it would be very helpful if we had:RouteLoadingData<'...'>
- get the type of the loader data for the particular pathRouteContext<'...'>
- get the type of the context for the particular pathBeta Was this translation helpful? Give feedback.
All reactions