Skip to content

Commit

Permalink
fix(router): pass options on scoped router navigation (#6923)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdunk authored and juice49 committed Jun 13, 2024
1 parent fda9387 commit 2fabc2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sanity/src/router/RouteScope.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {type ReactElement, type ReactNode, useCallback, useMemo, useRef} from 'react'
import {RouterContext} from 'sanity/_singletons'

import {type RouterContextValue, type RouterState} from './types'
import {type NavigateOptions, type RouterContextValue, type RouterState} from './types'
import {useRouter} from './useRouter'

function addScope(
Expand Down Expand Up @@ -94,7 +94,8 @@ export function RouteScope(props: RouteScopeProps): ReactElement {
)

const navigate = useCallback(
(nextState: RouterState) => parent_navigate(resolveNextParentState(nextState)),
(nextState: RouterState, options?: NavigateOptions) =>
parent_navigate(resolveNextParentState(nextState), options),
[parent_navigate, resolveNextParentState],
)

Expand Down

0 comments on commit 2fabc2e

Please sign in to comment.