Replies: 2 comments 4 replies
-
Converted this request from an issue to a discussion to go through our Open Governance process. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The approach in #14218 doesn't work because that types every match with the same |
Beta Was this translation helpful? Give feedback.
4 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.
-
Reproduction
Try to write a hook to generate breadcrumbs using
useMatches
such as:There will be a typescript error because
handle
is defaulted to unknown, which forces us to write:System Info
Used Package Manager
npm
Expected Behavior
There should be a way to pass the generics of returned
UIMatch
from theuseMatches()
hook. Maybe auseMatches<A = unknown, B = unknown>(): UIMatch<A, B>[]
would be non breaking and appropriate.Actual Behavior
There's no way to type correctly without making use of
as
because the default type ofhandle
isunknown
Beta Was this translation helpful? Give feedback.
All reactions