You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the new or updated feature that you are suggesting?
I am interested in having the possibility to declare the parameters used within useMatch such as useMatch(':domain/:id/:category') with a generic version of useMatch to supply something such as this:
The feature helps to refactor usages in expressions such as active={match?.params.category === path} which are otherwised not strictly typed since params is of type Record<string, string> right now. Changing the name of a param in the path pattern is inherently unsafe, however when there is an explicit generic type parameter one might be forced to update the underlying type and automatically refactor all usages.
The text was updated successfully, but these errors were encountered:
chaance
changed the title
[v6][Feature]: useMatch params aren't type-safe
[v6] [Feature]: useMatch params aren't type-safe
Sep 4, 2021
What is the new or updated feature that you are suggesting?
I am interested in having the possibility to declare the parameters used within
useMatch
such asuseMatch(':domain/:id/:category')
with a generic version ofuseMatch
to supply something such as this:Why should this feature be included?
The feature helps to refactor usages in expressions such as
active={match?.params.category === path}
which are otherwised not strictly typed sinceparams
is of typeRecord<string, string>
right now. Changing the name of a param in the path pattern is inherently unsafe, however when there is an explicit generic type parameter one might be forced to update the underlying type and automatically refactor all usages.The text was updated successfully, but these errors were encountered: