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
Describe what's incorrect/missing in the documentation
Hello,
The documentation comment for useLocation().hash states:
A URL fragment identifier, beginning with a #.
If this is a strict rule, it would be convenient if these values could be typed as '' | `#${string}` instead of string. This is especially useful if hash is passed along to another function that impose a stricter input type, and will allow us to avoid an if/else clause or having to type cast.
Likewise, the documentation comment for useLocation().search states:
A URL search string, beginning with a ?.
So this value could be typed as '' | `?${string}` instead of string. (Alternatively, '' | `?${string}=${string}` or '' | `?${string}=${string}` | `?${string}=${string}&${string}=${string}` would be valid too. However, this would probably add unnecessary confusion because it doesn’t suggest that the string can contain multiple &${string}=${string} segments).
I’m willing to submit a PR
The text was updated successfully, but these errors were encountered:
Describe what's incorrect/missing in the documentation
Hello,
The documentation comment for
useLocation().hash
states:If this is a strict rule, it would be convenient if these values could be typed as
'' | `#${string}`
instead ofstring
. This is especially useful ifhash
is passed along to another function that impose a stricter input type, and will allow us to avoid anif
/else
clause or having to type cast.Likewise, the documentation comment for
useLocation().search
states:So this value could be typed as
'' | `?${string}`
instead ofstring
. (Alternatively,'' | `?${string}=${string}`
or'' | `?${string}=${string}` | `?${string}=${string}&${string}=${string}`
would be valid too. However, this would probably add unnecessary confusion because it doesn’t suggest that the string can contain multiple&${string}=${string}
segments).I’m willing to submit a PR
The text was updated successfully, but these errors were encountered: