Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…61419) ### What? Let the developer check the instance of `ReadonlyURLSearchParams` to match against `URLSearchParams` ### Why? `useSearchParams()`'s return type is `ReadonlyURLSearchParams` which implements all the methods of `URLSearchParams`, therefore its type should be extended from `URLSearchParams` as well. Deprecated methods are also implemented to throw an error, so no runtime behavior is being changed ### How? Mark the unavailable methods as `@deprecated` which will visually mark them in IDEs: ![image](https://github.com/vercel/next.js/assets/18369201/f3de2858-14ac-4021-981d-b0267610faa7) This is similar how `ReadonlyHeaders` extends `Headers`, added in: #49075 [Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1706628877916779) Closes NEXT-2305
- Loading branch information