diff --git a/packages/nuqs/src/adapters/lib/react-router.ts b/packages/nuqs/src/adapters/lib/react-router.ts index 846d6758..408b2df6 100644 --- a/packages/nuqs/src/adapters/lib/react-router.ts +++ b/packages/nuqs/src/adapters/lib/react-router.ts @@ -16,6 +16,7 @@ type NavigateUrl = { type NavigateOptions = { replace?: boolean preventScrollReset?: boolean + state?: unknown } type NavigateFn = (url: NavigateUrl, options: NavigateOptions) => void type UseNavigate = () => NavigateFn @@ -60,7 +61,8 @@ export function createReactRouterBasedAdapter( }, { replace: true, - preventScrollReset: true + preventScrollReset: true, + state: history.state?.usr } ) }