react-router 0.0.0-experimental-2eb7164 → 0.0.0-experimental-3d7dcee
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/{chunk-DMYOHO3D.js → chunk-LSB26UC6.js} +143 -143
- package/dist/development/{chunk-CM3L6EBM.mjs → chunk-QMIAKNRH.mjs} +2 -2
- package/dist/development/{chunk-PFFPX2WQ.js → chunk-S2WJDCRE.js} +7 -7
- package/dist/development/{chunk-433YBOKX.mjs → chunk-WJ2QP6HN.mjs} +21 -21
- package/dist/development/{context-DY_GBoQM.d.mts → context-DnZM5brG.d.mts} +7 -7
- package/dist/development/dom-export.d.mts +4 -4
- package/dist/development/dom-export.d.ts +4 -4
- package/dist/development/dom-export.js +4 -4
- package/dist/development/dom-export.mjs +4 -4
- package/dist/{production/index-react-server-client-ByWQ94sU.d.mts → development/index-react-server-client-9rHNv-U3.d.mts} +2 -2
- package/dist/{production/index-react-server-client-pJZFIoFI.d.ts → development/index-react-server-client-zr5eNeut.d.ts} +1 -1
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.d.mts +6 -6
- package/dist/development/index.d.ts +4 -4
- package/dist/development/index.js +102 -102
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-DZyLihZ0.d.mts → route-data-C24VEkoE.d.mts} +1 -1
- package/dist/development/{routeModules-iYhSy-FD.d.ts → routeModules-FY5IBiA_.d.ts} +7 -7
- package/dist/production/{chunk-G343FNS2.mjs → chunk-2BFZ6QQU.mjs} +21 -21
- package/dist/production/{chunk-MFKHDFBJ.js → chunk-7CWVKQLP.js} +7 -7
- package/dist/production/{chunk-GALNUNJG.js → chunk-NIW37A6Q.js} +143 -143
- package/dist/production/{chunk-VQTSL3FX.mjs → chunk-OFC37UQM.mjs} +2 -2
- package/dist/production/{context-DY_GBoQM.d.mts → context-DnZM5brG.d.mts} +7 -7
- package/dist/production/dom-export.d.mts +4 -4
- package/dist/production/dom-export.d.ts +4 -4
- package/dist/production/dom-export.js +4 -4
- package/dist/production/dom-export.mjs +4 -4
- package/dist/{development/index-react-server-client-ByWQ94sU.d.mts → production/index-react-server-client-9rHNv-U3.d.mts} +2 -2
- package/dist/{development/index-react-server-client-pJZFIoFI.d.ts → production/index-react-server-client-zr5eNeut.d.ts} +1 -1
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.d.mts +6 -6
- package/dist/production/index.d.ts +4 -4
- package/dist/production/index.js +102 -102
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-DZyLihZ0.d.mts → route-data-C24VEkoE.d.mts} +1 -1
- package/dist/production/{routeModules-iYhSy-FD.d.ts → routeModules-FY5IBiA_.d.ts} +7 -7
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-3d7dcee
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
isSession,
|
|
32
32
|
routeRSCServerRequest,
|
|
33
33
|
setDevServerHooks
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QMIAKNRH.mjs";
|
|
35
35
|
import {
|
|
36
36
|
Action,
|
|
37
37
|
Await,
|
|
@@ -140,7 +140,7 @@ import {
|
|
|
140
140
|
withComponentProps,
|
|
141
141
|
withErrorBoundaryProps,
|
|
142
142
|
withHydrateFallbackProps
|
|
143
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-WJ2QP6HN.mjs";
|
|
144
144
|
export {
|
|
145
145
|
Await,
|
|
146
146
|
BrowserRouter,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule, L as LinkDescriptor, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-
|
|
2
|
-
import { L as Location, b as unstable_MiddlewareNextFunction } from '../../context-
|
|
1
|
+
import { R as RouteModule, L as LinkDescriptor, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-C24VEkoE.mjs';
|
|
2
|
+
import { L as Location, b as unstable_MiddlewareNextFunction } from '../../context-DnZM5brG.mjs';
|
|
3
3
|
import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RouteModule, L as LinkDescriptor, a as Location, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, u as unstable_MiddlewareNextFunction, C as ClientDataFunctionArgs, b as ServerDataFrom, N as Normalize, c as GetActionData } from '../../routeModules-
|
|
1
|
+
import { R as RouteModule, L as LinkDescriptor, a as Location, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, u as unstable_MiddlewareNextFunction, C as ClientDataFunctionArgs, b as ServerDataFrom, N as Normalize, c as GetActionData } from '../../routeModules-FY5IBiA_.js';
|
|
2
2
|
import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactElement } from 'react';
|
|
2
|
-
import { A as ActionFunctionArgs, c as LoaderFunctionArgs, d as ActionFunction, e as LoaderFunction, P as Params, L as Location, D as DataRouteMatch, f as unstable_MiddlewareFunction, S as ShouldRevalidateFunction, g as unstable_RouterContextProvider, h as DataWithResponseInit, M as MiddlewareEnabled } from './context-
|
|
2
|
+
import { A as ActionFunctionArgs, c as LoaderFunctionArgs, d as ActionFunction, e as LoaderFunction, P as Params, L as Location, D as DataRouteMatch, f as unstable_MiddlewareFunction, S as ShouldRevalidateFunction, g as unstable_RouterContextProvider, h as DataWithResponseInit, M as MiddlewareEnabled } from './context-DnZM5brG.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* An object of unknown type for route loaders and actions provided by the
|
|
@@ -1638,7 +1638,7 @@ type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<R
|
|
|
1638
1638
|
interface DataRouterContextObject extends Omit<NavigationContextObject, "future"> {
|
|
1639
1639
|
router: Router$1;
|
|
1640
1640
|
staticContext?: StaticHandlerContext;
|
|
1641
|
-
|
|
1641
|
+
unstable_onError?: unstable_ClientOnErrorFunction;
|
|
1642
1642
|
}
|
|
1643
1643
|
declare const DataRouterContext: React.Context<DataRouterContextObject | null>;
|
|
1644
1644
|
declare const DataRouterStateContext: React.Context<RouterState | null>;
|
|
@@ -1774,7 +1774,7 @@ declare function createMemoryRouter(routes: RouteObject[], opts?: MemoryRouterOp
|
|
|
1774
1774
|
* Function signature for client side error handling for loader/actions errors
|
|
1775
1775
|
* and rendering errors via `componentDidCatch`
|
|
1776
1776
|
*/
|
|
1777
|
-
interface
|
|
1777
|
+
interface unstable_ClientOnErrorFunction {
|
|
1778
1778
|
(error: unknown, errorInfo?: React.ErrorInfo): void;
|
|
1779
1779
|
}
|
|
1780
1780
|
/**
|
|
@@ -1806,13 +1806,13 @@ interface RouterProviderProps {
|
|
|
1806
1806
|
* and is only present for render errors.
|
|
1807
1807
|
*
|
|
1808
1808
|
* ```tsx
|
|
1809
|
-
* <RouterProvider
|
|
1809
|
+
* <RouterProvider unstable_onError=(error, errorInfo) => {
|
|
1810
1810
|
* console.error(error, errorInfo);
|
|
1811
1811
|
* reportToErrorService(error, errorInfo);
|
|
1812
1812
|
* }} />
|
|
1813
1813
|
* ```
|
|
1814
1814
|
*/
|
|
1815
|
-
|
|
1815
|
+
unstable_onError?: unstable_ClientOnErrorFunction;
|
|
1816
1816
|
}
|
|
1817
1817
|
/**
|
|
1818
1818
|
* Render the UI for the given {@link DataRouter}. This component should
|
|
@@ -1841,11 +1841,11 @@ interface RouterProviderProps {
|
|
|
1841
1841
|
* @mode data
|
|
1842
1842
|
* @param props Props
|
|
1843
1843
|
* @param {RouterProviderProps.flushSync} props.flushSync n/a
|
|
1844
|
+
* @param {RouterProviderProps.unstable_onError} props.unstable_onError n/a
|
|
1844
1845
|
* @param {RouterProviderProps.router} props.router n/a
|
|
1845
|
-
* @param {RouterProviderProps.unstable_handleError} props.unstable_handleError n/a
|
|
1846
1846
|
* @returns React element for the rendered router
|
|
1847
1847
|
*/
|
|
1848
|
-
declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl,
|
|
1848
|
+
declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, unstable_onError, }: RouterProviderProps): React.ReactElement;
|
|
1849
1849
|
/**
|
|
1850
1850
|
* @category Types
|
|
1851
1851
|
*/
|
|
@@ -3007,4 +3007,4 @@ type RouteComponent = ComponentType<{}>;
|
|
|
3007
3007
|
*/
|
|
3008
3008
|
type RouteHandle = unknown;
|
|
3009
3009
|
|
|
3010
|
-
export { type StaticHandler as $, Action as A, type BlockerFunction as B, type ClientDataFunctionArgs as C, type DataStrategyFunction as D, type ErrorBoundaryType as E, unstable_RouterContextProvider as F, type GetLoaderData as G, type HydrationState as H, type InitialEntry as I, type MiddlewareEnabled as J, type Equal as K, type LinkDescriptor as L, type MetaDescriptor as M, type Normalize as N, type ClientActionFunction as O, type Pretty as P, type ClientLoaderFunction as Q, type RouteModule$1 as R, type ServerDataFunctionArgs as S, type To as T, type UIMatch as U, type HeadersFunction as V, type ShouldRevalidateFunction as W, type RouterInit as X, type RouterState as Y, type PatchRoutesOnNavigationFunction as Z, type DataRouteObject as _, type Location as a, RouterProvider as a$, type GetScrollPositionFunction as a0, type GetScrollRestorationKeyFunction as a1, type StaticHandlerContext as a2, type Fetcher as a3, type NavigationStates as a4, type RouterSubscriber as a5, type RouterNavigateOptions as a6, type RouterFetchOptions as a7, type RevalidationState as a8, type ActionFunctionArgs as a9, redirect as aA, redirectDocument as aB, replace as aC, resolvePath as aD, type DataRouteMatch as aE, type Navigator as aF, type PatchRoutesOnNavigationFunctionArgs as aG, type RouteMatch as aH, type AwaitProps as aI, type IndexRouteProps as aJ, type
|
|
3010
|
+
export { type StaticHandler as $, Action as A, type BlockerFunction as B, type ClientDataFunctionArgs as C, type DataStrategyFunction as D, type ErrorBoundaryType as E, unstable_RouterContextProvider as F, type GetLoaderData as G, type HydrationState as H, type InitialEntry as I, type MiddlewareEnabled as J, type Equal as K, type LinkDescriptor as L, type MetaDescriptor as M, type Normalize as N, type ClientActionFunction as O, type Pretty as P, type ClientLoaderFunction as Q, type RouteModule$1 as R, type ServerDataFunctionArgs as S, type To as T, type UIMatch as U, type HeadersFunction as V, type ShouldRevalidateFunction as W, type RouterInit as X, type RouterState as Y, type PatchRoutesOnNavigationFunction as Z, type DataRouteObject as _, type Location as a, RouterProvider as a$, type GetScrollPositionFunction as a0, type GetScrollRestorationKeyFunction as a1, type StaticHandlerContext as a2, type Fetcher as a3, type NavigationStates as a4, type RouterSubscriber as a5, type RouterNavigateOptions as a6, type RouterFetchOptions as a7, type RevalidationState as a8, type ActionFunctionArgs as a9, redirect as aA, redirectDocument as aB, replace as aC, resolvePath as aD, type DataRouteMatch as aE, type Navigator as aF, type PatchRoutesOnNavigationFunctionArgs as aG, type RouteMatch as aH, type AwaitProps as aI, type IndexRouteProps as aJ, type unstable_ClientOnErrorFunction as aK, type LayoutRouteProps as aL, type MemoryRouterOpts as aM, type MemoryRouterProps as aN, type NavigateProps as aO, type OutletProps as aP, type PathRouteProps as aQ, type RouteProps as aR, type RouterProps as aS, type RouterProviderProps as aT, type RoutesProps as aU, Await as aV, MemoryRouter as aW, Navigate as aX, Outlet as aY, Route as aZ, Router as a_, type DataStrategyFunctionArgs as aa, type DataStrategyMatch as ab, type DataStrategyResult as ac, DataWithResponseInit as ad, type ErrorResponse as ae, type FormEncType as af, type FormMethod as ag, type HTMLFormMethod as ah, type LazyRouteFunction as ai, type LoaderFunctionArgs as aj, type unstable_MiddlewareFunction as ak, type PathParam as al, type RedirectFunction as am, type unstable_RouterContext as an, type ShouldRevalidateFunctionArgs as ao, unstable_createContext as ap, createPath as aq, parsePath as ar, IDLE_NAVIGATION as as, IDLE_FETCHER as at, IDLE_BLOCKER as au, data as av, generatePath as aw, isRouteErrorResponse as ax, matchPath as ay, matchRoutes as az, type ServerDataFrom as b, Routes as b0, createMemoryRouter as b1, createRoutesFromChildren as b2, createRoutesFromElements as b3, renderMatches as b4, type ClientActionFunctionArgs as b5, type ClientLoaderFunctionArgs as b6, type HeadersArgs as b7, type MetaArgs as b8, type PageLinkDescriptor as b9, type CreateStaticHandlerOptions as bA, type HtmlLinkDescriptor as ba, type Future as bb, type unstable_SerializesTo as bc, createBrowserHistory as bd, invariant as be, createRouter as bf, ErrorResponseImpl as bg, DataRouterContext as bh, DataRouterStateContext as bi, FetchersContext as bj, LocationContext as bk, NavigationContext as bl, RouteContext as bm, ViewTransitionContext as bn, hydrationRouteProperties as bo, mapRouteProperties as bp, WithComponentProps as bq, withComponentProps as br, WithHydrateFallbackProps as bs, withHydrateFallbackProps as bt, WithErrorBoundaryProps as bu, withErrorBoundaryProps as bv, type RouteManifest as bw, type ServerRouteModule as bx, type History as by, type FutureConfig as bz, type GetActionData as c, type Router$1 as d, type RouteModules as e, type NavigateOptions as f, type Blocker as g, type SerializeFrom as h, type RelativeRoutingType as i, type ParamParseKey as j, type Path as k, type PathPattern as l, type PathMatch as m, type Navigation as n, type Params as o, type RouteObject as p, type IndexRouteObject as q, type RouteComponentType as r, type HydrateFallbackType as s, type LoaderFunction as t, type unstable_MiddlewareNextFunction as u, type ActionFunction as v, type MetaFunction as w, type LinksFunction as x, type NonIndexRouteObject as y, type AppLoadContext as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-3d7dcee
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -5149,7 +5149,7 @@ function useResolvedPath(to, { relative } = {}) {
|
|
|
5149
5149
|
function useRoutes(routes, locationArg) {
|
|
5150
5150
|
return useRoutesImpl(routes, locationArg);
|
|
5151
5151
|
}
|
|
5152
|
-
function useRoutesImpl(routes, locationArg, dataRouterState,
|
|
5152
|
+
function useRoutesImpl(routes, locationArg, dataRouterState, unstable_onError, future) {
|
|
5153
5153
|
invariant(
|
|
5154
5154
|
useInRouterContext(),
|
|
5155
5155
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
@@ -5221,7 +5221,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
5221
5221
|
),
|
|
5222
5222
|
parentMatches,
|
|
5223
5223
|
dataRouterState,
|
|
5224
|
-
|
|
5224
|
+
unstable_onError,
|
|
5225
5225
|
future
|
|
5226
5226
|
);
|
|
5227
5227
|
if (locationArg && renderedMatches) {
|
|
@@ -5290,8 +5290,8 @@ var RenderErrorBoundary = class extends React2.Component {
|
|
|
5290
5290
|
};
|
|
5291
5291
|
}
|
|
5292
5292
|
componentDidCatch(error, errorInfo) {
|
|
5293
|
-
if (this.props.
|
|
5294
|
-
this.props.
|
|
5293
|
+
if (this.props.unstable_onError) {
|
|
5294
|
+
this.props.unstable_onError(error, errorInfo);
|
|
5295
5295
|
} else {
|
|
5296
5296
|
console.error(
|
|
5297
5297
|
"React Router caught the following error during render",
|
|
@@ -5316,7 +5316,7 @@ function RenderedRoute({ routeContext, match, children }) {
|
|
|
5316
5316
|
}
|
|
5317
5317
|
return /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: routeContext }, children);
|
|
5318
5318
|
}
|
|
5319
|
-
function _renderMatches(matches, parentMatches = [], dataRouterState = null,
|
|
5319
|
+
function _renderMatches(matches, parentMatches = [], dataRouterState = null, unstable_onError = null, future = null) {
|
|
5320
5320
|
if (matches == null) {
|
|
5321
5321
|
if (!dataRouterState) {
|
|
5322
5322
|
return null;
|
|
@@ -5429,7 +5429,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
|
|
|
5429
5429
|
error,
|
|
5430
5430
|
children: getChildren(),
|
|
5431
5431
|
routeContext: { outlet: null, matches: matches2, isDataRoute: true },
|
|
5432
|
-
|
|
5432
|
+
unstable_onError
|
|
5433
5433
|
}
|
|
5434
5434
|
) : getChildren();
|
|
5435
5435
|
},
|
|
@@ -5696,7 +5696,7 @@ var Deferred = class {
|
|
|
5696
5696
|
function RouterProvider({
|
|
5697
5697
|
router,
|
|
5698
5698
|
flushSync: reactDomFlushSyncImpl,
|
|
5699
|
-
|
|
5699
|
+
unstable_onError
|
|
5700
5700
|
}) {
|
|
5701
5701
|
let [state, setStateImpl] = React3.useState(router.state);
|
|
5702
5702
|
let [pendingState, setPendingState] = React3.useState();
|
|
@@ -5710,17 +5710,17 @@ function RouterProvider({
|
|
|
5710
5710
|
let logErrorsAndSetState = React3.useCallback(
|
|
5711
5711
|
(newState) => {
|
|
5712
5712
|
setStateImpl((prevState) => {
|
|
5713
|
-
if (newState.errors &&
|
|
5713
|
+
if (newState.errors && unstable_onError) {
|
|
5714
5714
|
Object.entries(newState.errors).forEach(([routeId, error]) => {
|
|
5715
5715
|
if (prevState.errors?.[routeId] !== error) {
|
|
5716
|
-
|
|
5716
|
+
unstable_onError(error);
|
|
5717
5717
|
}
|
|
5718
5718
|
});
|
|
5719
5719
|
}
|
|
5720
5720
|
return newState;
|
|
5721
5721
|
});
|
|
5722
5722
|
},
|
|
5723
|
-
[
|
|
5723
|
+
[unstable_onError]
|
|
5724
5724
|
);
|
|
5725
5725
|
let setState = React3.useCallback(
|
|
5726
5726
|
(newState, { deletedFetchers, flushSync, viewTransitionOpts }) => {
|
|
@@ -5863,9 +5863,9 @@ function RouterProvider({
|
|
|
5863
5863
|
navigator,
|
|
5864
5864
|
static: false,
|
|
5865
5865
|
basename,
|
|
5866
|
-
|
|
5866
|
+
unstable_onError
|
|
5867
5867
|
}),
|
|
5868
|
-
[router, navigator, basename,
|
|
5868
|
+
[router, navigator, basename, unstable_onError]
|
|
5869
5869
|
);
|
|
5870
5870
|
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React3.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React3.createElement(FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React3.createElement(ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ React3.createElement(
|
|
5871
5871
|
Router,
|
|
@@ -5881,7 +5881,7 @@ function RouterProvider({
|
|
|
5881
5881
|
routes: router.routes,
|
|
5882
5882
|
future: router.future,
|
|
5883
5883
|
state,
|
|
5884
|
-
|
|
5884
|
+
unstable_onError
|
|
5885
5885
|
}
|
|
5886
5886
|
)
|
|
5887
5887
|
))))), null);
|
|
@@ -5891,9 +5891,9 @@ function DataRoutes({
|
|
|
5891
5891
|
routes,
|
|
5892
5892
|
future,
|
|
5893
5893
|
state,
|
|
5894
|
-
|
|
5894
|
+
unstable_onError
|
|
5895
5895
|
}) {
|
|
5896
|
-
return useRoutesImpl(routes, void 0, state,
|
|
5896
|
+
return useRoutesImpl(routes, void 0, state, unstable_onError, future);
|
|
5897
5897
|
}
|
|
5898
5898
|
function MemoryRouter({
|
|
5899
5899
|
basename,
|
|
@@ -6047,7 +6047,7 @@ function Await({
|
|
|
6047
6047
|
{
|
|
6048
6048
|
resolve,
|
|
6049
6049
|
errorElement,
|
|
6050
|
-
|
|
6050
|
+
unstable_onError: dataRouterContext?.unstable_onError
|
|
6051
6051
|
},
|
|
6052
6052
|
/* @__PURE__ */ React3.createElement(ResolveAwait, null, children)
|
|
6053
6053
|
);
|
|
@@ -6061,8 +6061,8 @@ var AwaitErrorBoundary = class extends React3.Component {
|
|
|
6061
6061
|
return { error };
|
|
6062
6062
|
}
|
|
6063
6063
|
componentDidCatch(error, errorInfo) {
|
|
6064
|
-
if (this.props.
|
|
6065
|
-
this.props.
|
|
6064
|
+
if (this.props.unstable_onError) {
|
|
6065
|
+
this.props.unstable_onError(error, errorInfo);
|
|
6066
6066
|
} else {
|
|
6067
6067
|
console.error(
|
|
6068
6068
|
"<Await> caught the following error during render",
|
|
@@ -6096,7 +6096,7 @@ var AwaitErrorBoundary = class extends React3.Component {
|
|
|
6096
6096
|
promise = resolve.then(
|
|
6097
6097
|
(data2) => Object.defineProperty(resolve, "_data", { get: () => data2 }),
|
|
6098
6098
|
(error) => {
|
|
6099
|
-
this.props.
|
|
6099
|
+
this.props.unstable_onError?.(error);
|
|
6100
6100
|
Object.defineProperty(resolve, "_error", { get: () => error });
|
|
6101
6101
|
}
|
|
6102
6102
|
);
|
|
@@ -9036,7 +9036,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
9036
9036
|
try {
|
|
9037
9037
|
if (isBrowser) {
|
|
9038
9038
|
window.__reactRouterVersion = // @ts-expect-error
|
|
9039
|
-
"0.0.0-experimental-
|
|
9039
|
+
"0.0.0-experimental-3d7dcee";
|
|
9040
9040
|
}
|
|
9041
9041
|
} catch (e) {
|
|
9042
9042
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-3d7dcee
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -6330,7 +6330,7 @@ function useResolvedPath(to, { relative } = {}) {
|
|
|
6330
6330
|
function useRoutes(routes, locationArg) {
|
|
6331
6331
|
return useRoutesImpl(routes, locationArg);
|
|
6332
6332
|
}
|
|
6333
|
-
function useRoutesImpl(routes, locationArg, dataRouterState,
|
|
6333
|
+
function useRoutesImpl(routes, locationArg, dataRouterState, unstable_onError, future) {
|
|
6334
6334
|
invariant(
|
|
6335
6335
|
useInRouterContext(),
|
|
6336
6336
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
@@ -6402,7 +6402,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
6402
6402
|
),
|
|
6403
6403
|
parentMatches,
|
|
6404
6404
|
dataRouterState,
|
|
6405
|
-
|
|
6405
|
+
unstable_onError,
|
|
6406
6406
|
future
|
|
6407
6407
|
);
|
|
6408
6408
|
if (locationArg && renderedMatches) {
|
|
@@ -6471,8 +6471,8 @@ var RenderErrorBoundary = class extends React3.Component {
|
|
|
6471
6471
|
};
|
|
6472
6472
|
}
|
|
6473
6473
|
componentDidCatch(error, errorInfo) {
|
|
6474
|
-
if (this.props.
|
|
6475
|
-
this.props.
|
|
6474
|
+
if (this.props.unstable_onError) {
|
|
6475
|
+
this.props.unstable_onError(error, errorInfo);
|
|
6476
6476
|
} else {
|
|
6477
6477
|
console.error(
|
|
6478
6478
|
"React Router caught the following error during render",
|
|
@@ -6497,7 +6497,7 @@ function RenderedRoute({ routeContext, match, children }) {
|
|
|
6497
6497
|
}
|
|
6498
6498
|
return /* @__PURE__ */ React3.createElement(RouteContext.Provider, { value: routeContext }, children);
|
|
6499
6499
|
}
|
|
6500
|
-
function _renderMatches(matches, parentMatches = [], dataRouterState = null,
|
|
6500
|
+
function _renderMatches(matches, parentMatches = [], dataRouterState = null, unstable_onError = null, future = null) {
|
|
6501
6501
|
if (matches == null) {
|
|
6502
6502
|
if (!dataRouterState) {
|
|
6503
6503
|
return null;
|
|
@@ -6610,7 +6610,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
|
|
|
6610
6610
|
error,
|
|
6611
6611
|
children: getChildren(),
|
|
6612
6612
|
routeContext: { outlet: null, matches: matches2, isDataRoute: true },
|
|
6613
|
-
|
|
6613
|
+
unstable_onError
|
|
6614
6614
|
}
|
|
6615
6615
|
) : getChildren();
|
|
6616
6616
|
},
|