[Feature Request] Support typing useMatches() hook #10902
techieyann
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.
-
I'd much prefer passing the expected type over casting the result:
const matches = useMatches() as UIMatch<DataType, HandleType>[]
const matches = useMatches<DataType, HandleType>()
It is essentially the same thing, but it aligns with how you've implemented
useLoaderData()
and is cleaner IMO.Beta Was this translation helpful? Give feedback.
All reactions