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
useMatchessuch as:There will be a typescript error because
handleis defaulted to unknown, which forces us to write:System Info
Binaries: Node: 24.2.0 pnpm: 10.13.1 (The rest is irrelevant to my issue.)Used Package Manager
npm
Expected Behavior
There should be a way to pass the generics of returned
UIMatchfrom 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
asbecause the default type ofhandleisunknownBeta Was this translation helpful? Give feedback.
All reactions