Allow for Params
generic to be type safe
#11156
lifeiscontent
started this conversation in
Proposals
Replies: 0 comments
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.
-
using something like https://github.com/sandulat/routes-gen it provides a type safe routes.d.ts file with a
RouteParams
interface mapping to all the routes in a remix app, it would be nice to be able to useuseParams<RouteParams['/todos/:id']>
but this forces the useParams hook to return{id?: string}
which to my knowledge is not possible for this given route.Beta Was this translation helpful? Give feedback.
All reactions