Skip to content

Commit e5aa541

Browse files
committed
chore: generate markdown docs from jsdocs
1 parent a3b5b95 commit e5aa541

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/api/hooks/useSearchParams.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ setSearchParams([["tab", "1"]]);
5959
setSearchParams(new URLSearchParams("?tab=1"));
6060
```
6161

62-
It also supports a function callback like React's [`setState`](https://react.dev/reference/react/useState#setstate):
62+
It also supports a function callback like React's
63+
[`setState`](https://react.dev/reference/react/useState#setstate):
6364

6465
```tsx
6566
setSearchParams((searchParams) => {
@@ -68,6 +69,12 @@ setSearchParams((searchParams) => {
6869
});
6970
```
7071

72+
<docs-warning>The function callback version of `setSearchParams` does not support
73+
the [queueing](https://react.dev/reference/react/useState#setstate-parameters)
74+
logic that React's `setState` implements. Multiple calls to `setSearchParams`
75+
in the same tick will not build on the prior value. If you need this behavior,
76+
you can use `setState` manually.</docs-warning>
77+
7178
### Notes
7279

7380
Note that `searchParams` is a stable reference, so you can reliably use it

0 commit comments

Comments
 (0)