Replies: 2 comments 2 replies
-
Landed here for the same thing. |
Beta Was this translation helpful? Give feedback.
0 replies
-
With @types/[email protected] there seems to be another issue with ReadonlyURLSearchParams:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature you'd like to request
In Next 13, server components'
props.searchParams
is a plain object. In client components,useSearchParams()
returns an instance ofReadOnlyURLSearchParams
.These are 2 completely different interfaces, introducing unnecessary complexity when building APIs that are reusable in both server and client components.
Describe the solution you'd like
Server components'
props.searchParams
should be an instance ofReadOnlyURLSearchParams
.Describe alternatives you've considered
Alternatively,
useSearchParams()
could return a plain object. However,URLSearchParams
has been supported since Node v10 and is the proper interface for URL query parameters, so I think this would be the wrong approach.Beta Was this translation helpful? Give feedback.
All reactions