Skip to content

Commit a3e4b8e

Browse files
Add additional JSDocs to NavigateOptions (#12710)
These should appear both in VS Code and other IDEs, as well as in the reference docs website.
1 parent 9cb06c3 commit a3e4b8e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-router/lib/context.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,17 @@ export const AwaitContext = React.createContext<TrackedPromise | null>(null);
128128
AwaitContext.displayName = "Await";
129129

130130
export interface NavigateOptions {
131+
/** Replace the current entry in the history stack instead of pushing a new one */
131132
replace?: boolean;
133+
/** Adds persistent client side routing state to the next location */
132134
state?: any;
135+
/** If you are using {@link https://api.reactrouter.com/v7/functions/react_router.ScrollRestoration.html <ScrollRestoration>}, prevent the scroll position from being reset to the top of the window when navigating */
133136
preventScrollReset?: boolean;
137+
/** Defines the relative path behavior for the link. "route" will use the route hierarchy so ".." will remove all URL segments of the current route pattern while "path" will use the URL path so ".." will remove one URL segment. */
134138
relative?: RelativeRoutingType;
139+
/** Wraps the initial state update for this navigation in a {@link https://react.dev/reference/react-dom/flushSync ReactDOM.flushSync} call instead of the default {@link https://react.dev/reference/react/startTransition React.startTransition} */
135140
flushSync?: boolean;
141+
/** Enables a {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API View Transition} for this navigation by wrapping the final state update in `document.startViewTransition()`. If you need to apply specific styles for this view transition, you will also need to leverage the {@link https://api.reactrouter.com/v7/functions/react_router.useViewTransitionState.html useViewTransitionState()} hook. */
136142
viewTransition?: boolean;
137143
}
138144

0 commit comments

Comments
 (0)