@@ -4157,7 +4157,7 @@ function useFalconApiContext() {
41574157}
41584158
41594159/**
4160- * react-router v7.8.1
4160+ * react-router v7.8.2
41614161 *
41624162 * Copyright (c) Remix Software Inc.
41634163 *
@@ -4721,7 +4721,7 @@ function useResolvedPath(to, { relative } = {}) {
47214721 [to, routePathnamesJson, locationPathname, relative]
47224722 );
47234723}
4724- function useRoutesImpl(routes, locationArg, dataRouterState, future) {
4724+ function useRoutesImpl(routes, locationArg, dataRouterState, unstable_onError, future) {
47254725 invariant(
47264726 useInRouterContext(),
47274727 // TODO: This error is probably because they somehow have 2 versions of the
@@ -4786,6 +4786,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
47864786 ),
47874787 parentMatches,
47884788 dataRouterState,
4789+ unstable_onError,
47894790 future
47904791 );
47914792 return renderedMatches;
@@ -4835,11 +4836,14 @@ var RenderErrorBoundary = class extends reactExports.Component {
48354836 };
48364837 }
48374838 componentDidCatch(error, errorInfo) {
4838- console.error(
4839- "React Router caught the following error during render",
4840- error,
4841- errorInfo
4842- );
4839+ if (this.props.unstable_onError) {
4840+ this.props.unstable_onError(error, errorInfo);
4841+ } else {
4842+ console.error(
4843+ "React Router caught the following error during render",
4844+ error
4845+ );
4846+ }
48434847 }
48444848 render() {
48454849 return this.state.error !== void 0 ? /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { value: this.props.routeContext }, /* @__PURE__ */ reactExports.createElement(
@@ -4858,7 +4862,7 @@ function RenderedRoute({ routeContext, match, children }) {
48584862 }
48594863 return /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { value: routeContext }, children);
48604864}
4861- function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null) {
4865+ function _renderMatches(matches, parentMatches = [], dataRouterState = null, unstable_onError = null, future = null) {
48624866 if (matches == null) {
48634867 if (!dataRouterState) {
48644868 return null;
@@ -4970,7 +4974,8 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
49704974 component: errorElement,
49714975 error,
49724976 children: getChildren(),
4973- routeContext: { outlet: null, matches: matches2, isDataRoute: true }
4977+ routeContext: { outlet: null, matches: matches2, isDataRoute: true },
4978+ unstable_onError
49744979 }
49754980 ) : getChildren();
49764981 },
@@ -5048,9 +5053,10 @@ reactExports.memo(DataRoutes);
50485053function DataRoutes({
50495054 routes,
50505055 future,
5051- state
5056+ state,
5057+ unstable_onError
50525058}) {
5053- return useRoutesImpl(routes, void 0, state, future);
5059+ return useRoutesImpl(routes, void 0, state, unstable_onError, future);
50545060}
50555061
50565062// lib/dom/dom.ts
@@ -5547,7 +5553,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
55475553try {
55485554 if (isBrowser) {
55495555 window.__reactRouterVersion = // @ts-expect-error
5550- "7.8.1 ";
5556+ "7.8.2 ";
55515557 }
55525558} catch (e) {
55535559}
0 commit comments