Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
remix-run-bot committed Jan 5, 2024
1 parent afff36b commit 0b6e969
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/hooks/use-search-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ The first value returned is a Web [URLSearchParams][url-search-params] object.

### `setSearchParams(params, navigateOptions)`

The second value returned is a function to set new search params and causes a navigation when called. You can pass an optional second argument with [navigate options][navigateOptions] to configure the navigation.
The second value returned is a function to set new search params and causes a navigation when called. You can pass an optional second argument with [navigate options][navigateoptions] to configure the navigation.

```tsx
<button
onClick={() => {
const params = new URLSearchParams();
params.set("someKey", "someValue");
setSearchParams(params, {
preventScrollReset: true
preventScrollReset: true,
});
}}
/>
Expand All @@ -58,7 +58,6 @@ The setter function also supports a function for setting new search params.
/>
```


[search-params]: https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams
[url-search-params]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
[navigateOptions]: ./use-navigate#options
[navigateoptions]: ./use-navigate#options

0 comments on commit 0b6e969

Please sign in to comment.