API/toSearchParams
toSearchParams
src/utils/to-search-params.tsfunction
toSearchParams()
Section titled “toSearchParams()”toSearchParams(input: SearchParamsInput): URLSearchParamsCopy any SearchParamsInput into a new URLSearchParams.
Always a copy, so the result can be changed without touching the router’s
own object. A record’s array values become repeated keys, in order;
undefined values are left out. A URLSearchParams is recognised by its
getAll method rather than by instanceof, so one built in another realm —
a test DOM, an iframe — is copied too.
| Parameter | Type | Description |
|---|---|---|
input |
SearchParamsInput |
The query, as the router gave it |
Returns — A new URLSearchParams holding the same pairs
