OptionalflushOptionalonAn 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, pattern, errorInfo } = info;
console.error(error, location, errorInfo);
reportToErrorService(error, location, errorInfo);
}} />
The DataRouter instance to use for navigation and data fetching. The router prop should be a single router instance created outside of the React tree. Avoid creating new routers during React renders/re-renders.
OptionaluseControl whether router state updates are internally wrapped in
React.startTransition.
undefined, all state updates are wrapped in
React.startTransition
startTransition.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.false, the router will not leverage React.startTransition or
React.useOptimistic on any navigations or state changes.For more information, please see the docs.
The
ReactDOM.flushSyncimplementation to use for flushing updates.You usually don't have to worry about this:
RouterProviderexported fromreact-router/domhandles this internally for youRouterProviderfromreact-routerand ignore this prop