React Router API Reference
    Preparing search index...

    Interface RouterProviderProps

    interface RouterProviderProps {
        flushSync?: (fn: () => unknown) => undefined;
        onError?: ClientOnErrorFunction;
        router: DataRouter;
        unstable_useTransitions?: boolean;
    }
    Index

    Properties

    flushSync?: (fn: () => unknown) => undefined

    The ReactDOM.flushSync implementation to use for flushing updates.

    You usually don't have to worry about this:

    • The RouterProvider exported from react-router/dom handles this internally for you
    • If you are rendering in a non-DOM environment, you can import RouterProvider from react-router and ignore this prop

    An error handler function that will be called for any middleware, loader, action, or render errors that are encountered in your application. This is useful for logging or reporting errors instead of in the ErrorBoundary because it's not subject to re-rendering and will only run one time per error.

    The errorInfo parameter is passed along from componentDidCatch and is only present for render errors.

    <RouterProvider onError=(error, info) => {
    let { location, params, unstable_pattern, errorInfo } = info;
    console.error(error, location, errorInfo);
    reportToErrorService(error, location, errorInfo);
    }} />
    router: DataRouter

    The DataRouter instance to use for navigation and data fetching.

    unstable_useTransitions?: boolean

    Control whether router state updates are internally wrapped in React.startTransition.

    • When left undefined, all state updates are wrapped in React.startTransition
      • This can lead to buggy behaviors if you are wrapping your own navigations/fetchers in startTransition.
    • When set to true, Link and Form navigations will be wrapped in React.startTransition and router state changes will be wrapped in React.startTransition and also sent through useOptimistic to surface mid-navigation router state changes to the UI.
    • When set to false, the router will not leverage React.startTransition or React.useOptimistic on any navigations or state changes.

    For more information, please see the docs.