Skip to content

Commit 1e72e95

Browse files
committed
fix: Forward user-defined location.state
1 parent ac9abdd commit 1e72e95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/nuqs/src/adapters/lib/react-router.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type NavigateUrl = {
1616
type NavigateOptions = {
1717
replace?: boolean
1818
preventScrollReset?: boolean
19+
state?: unknown
1920
}
2021
type NavigateFn = (url: NavigateUrl, options: NavigateOptions) => void
2122
type UseNavigate = () => NavigateFn
@@ -60,7 +61,8 @@ export function createReactRouterBasedAdapter(
6061
},
6162
{
6263
replace: true,
63-
preventScrollReset: true
64+
preventScrollReset: true,
65+
state: history.state?.usr
6466
}
6567
)
6668
}

0 commit comments

Comments
 (0)