File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ setSearchParams([["tab", "1"]]);
5959setSearchParams (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
6566setSearchParams ((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
7380Note that ` searchParams ` is a stable reference, so you can reliably use it
You can’t perform that action at this time.
0 commit comments