Replies: 1 comment
-
|
Running into the same problem. It is annoying to have to convert all of my numbers into strings to avoid the TypeScript error. |
Beta Was this translation helpful? Give feedback.
0 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.
-
I’ve been working with the generatePath function, and I noticed that the params type currently only accepts string | null:
However, in many practical cases, route parameters can also be number values. For example:
While this works at runtime (since the internal stringify() safely handles numbers using String(p)), the current TypeScript definition doesn't allow this and causes a type error.
Would it make sense to update the type to support number as well, like this?
This change would better reflect real-world usage and eliminate the need for unnecessary String() casts at the call site.
Curious to hear your thoughts on this. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions