Calling useSearchParams<{foo: string}> should make the returned searchParams type { foo?: string }. This is because we never know what kind of query params somebody will actually send.
Expected behavior 🤔
See previous
Steps to reproduce 🕹
assert that ReturnType<typeof useSearchParams<{ foo: 'foo';}>>[0] has type string | undefined
Duplicates
Latest version
Current behavior 😯
Calling
useSearchParams<{foo: string}>
should make the returnedsearchParams
type{ foo?: string }
. This is because we never know what kind of query params somebody will actually send.Expected behavior 🤔
See previous
Steps to reproduce 🕹
assert that
ReturnType<typeof useSearchParams<{ foo: 'foo';}>>[0]
has typestring | undefined
Context 🔦
No response
Your environment 🌎
No response