@tanstack/react-router 1.32.15 → 1.32.17
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/cjs/Matches.cjs +7 -36
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/Matches.d.cts +2 -11
- package/dist/cjs/fileRoute.cjs +7 -5
- package/dist/cjs/fileRoute.cjs.map +1 -1
- package/dist/cjs/index.cjs +8 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +6 -2
- package/dist/cjs/link.cjs +2 -2
- package/dist/cjs/link.cjs.map +1 -1
- package/dist/cjs/root.cjs +5 -0
- package/dist/cjs/root.cjs.map +1 -0
- package/dist/cjs/root.d.cts +2 -0
- package/dist/cjs/route.cjs +19 -18
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +1 -2
- package/dist/cjs/router.cjs +65 -52
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/useLoaderData.cjs +13 -0
- package/dist/cjs/useLoaderData.cjs.map +1 -0
- package/dist/cjs/useLoaderData.d.cts +9 -0
- package/dist/cjs/useLoaderDeps.cjs +13 -0
- package/dist/cjs/useLoaderDeps.cjs.map +1 -0
- package/dist/cjs/useLoaderDeps.d.cts +9 -0
- package/dist/cjs/useMatch.cjs +41 -0
- package/dist/cjs/useMatch.cjs.map +1 -0
- package/dist/cjs/useMatch.d.cts +9 -0
- package/dist/cjs/useNavigate.cjs +2 -2
- package/dist/cjs/useNavigate.cjs.map +1 -1
- package/dist/cjs/useParams.cjs +2 -2
- package/dist/cjs/useParams.cjs.map +1 -1
- package/dist/cjs/useRouteContext.cjs +2 -2
- package/dist/cjs/useRouteContext.cjs.map +1 -1
- package/dist/cjs/useSearch.cjs +2 -2
- package/dist/cjs/useSearch.cjs.map +1 -1
- package/dist/esm/Matches.d.ts +2 -11
- package/dist/esm/Matches.js +7 -36
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/fileRoute.js +3 -1
- package/dist/esm/fileRoute.js.map +1 -1
- package/dist/esm/index.d.ts +6 -2
- package/dist/esm/index.js +6 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/link.js +1 -1
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/root.d.ts +2 -0
- package/dist/esm/root.js +5 -0
- package/dist/esm/root.js.map +1 -0
- package/dist/esm/route.d.ts +1 -2
- package/dist/esm/route.js +4 -3
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.js +16 -3
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/useLoaderData.d.ts +9 -0
- package/dist/esm/useLoaderData.js +13 -0
- package/dist/esm/useLoaderData.js.map +1 -0
- package/dist/esm/useLoaderDeps.d.ts +9 -0
- package/dist/esm/useLoaderDeps.js +13 -0
- package/dist/esm/useLoaderDeps.js.map +1 -0
- package/dist/esm/useMatch.d.ts +9 -0
- package/dist/esm/useMatch.js +24 -0
- package/dist/esm/useMatch.js.map +1 -0
- package/dist/esm/useNavigate.js +1 -1
- package/dist/esm/useNavigate.js.map +1 -1
- package/dist/esm/useParams.js +1 -1
- package/dist/esm/useParams.js.map +1 -1
- package/dist/esm/useRouteContext.js +1 -1
- package/dist/esm/useRouteContext.js.map +1 -1
- package/dist/esm/useSearch.js +1 -1
- package/dist/esm/useSearch.js.map +1 -1
- package/package.json +1 -1
- package/src/Matches.tsx +20 -88
- package/src/fileRoute.ts +4 -2
- package/src/index.tsx +4 -5
- package/src/link.tsx +1 -1
- package/src/root.ts +2 -0
- package/src/route.ts +5 -3
- package/src/router.ts +18 -4
- package/src/useLoaderData.tsx +29 -0
- package/src/useLoaderDeps.tsx +29 -0
- package/src/useMatch.tsx +40 -0
- package/src/useNavigate.tsx +1 -1
- package/src/useParams.tsx +1 -1
- package/src/useRouteContext.ts +1 -1
- package/src/useSearch.tsx +1 -1
package/dist/cjs/router.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const history = require("@tanstack/history");
|
|
|
4
4
|
const reactStore = require("@tanstack/react-store");
|
|
5
5
|
const invariant = require("tiny-invariant");
|
|
6
6
|
const warning = require("tiny-warning");
|
|
7
|
-
const
|
|
7
|
+
const root = require("./root.cjs");
|
|
8
8
|
const searchParams = require("./searchParams.cjs");
|
|
9
9
|
const utils = require("./utils.cjs");
|
|
10
10
|
const RouterProvider = require("./RouterProvider.cjs");
|
|
@@ -220,13 +220,13 @@ class Router {
|
|
|
220
220
|
};
|
|
221
221
|
this.matchRoutes = (pathname, locationSearch, opts) => {
|
|
222
222
|
let routeParams = {};
|
|
223
|
-
const foundRoute = this.flatRoutes.find((
|
|
223
|
+
const foundRoute = this.flatRoutes.find((route) => {
|
|
224
224
|
const matchedParams = path.matchPathname(
|
|
225
225
|
this.basepath,
|
|
226
226
|
path.trimPathRight(pathname),
|
|
227
227
|
{
|
|
228
|
-
to:
|
|
229
|
-
caseSensitive:
|
|
228
|
+
to: route.fullPath,
|
|
229
|
+
caseSensitive: route.options.caseSensitive ?? this.options.caseSensitive,
|
|
230
230
|
fuzzy: true
|
|
231
231
|
}
|
|
232
232
|
);
|
|
@@ -236,7 +236,7 @@ class Router {
|
|
|
236
236
|
}
|
|
237
237
|
return false;
|
|
238
238
|
});
|
|
239
|
-
let routeCursor = foundRoute || this.routesById[
|
|
239
|
+
let routeCursor = foundRoute || this.routesById[root.rootRouteId];
|
|
240
240
|
const matchedRoutes = [routeCursor];
|
|
241
241
|
let isGlobalNotFound = false;
|
|
242
242
|
if (
|
|
@@ -262,19 +262,19 @@ class Router {
|
|
|
262
262
|
}
|
|
263
263
|
if (this.options.notFoundMode !== "root") {
|
|
264
264
|
for (let i = matchedRoutes.length - 1; i >= 0; i--) {
|
|
265
|
-
const
|
|
266
|
-
if (
|
|
267
|
-
return
|
|
265
|
+
const route = matchedRoutes[i];
|
|
266
|
+
if (route.children) {
|
|
267
|
+
return route.id;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
return
|
|
271
|
+
return root.rootRouteId;
|
|
272
272
|
})();
|
|
273
|
-
const parseErrors = matchedRoutes.map((
|
|
273
|
+
const parseErrors = matchedRoutes.map((route) => {
|
|
274
274
|
let parsedParamsError;
|
|
275
|
-
if (
|
|
275
|
+
if (route.options.parseParams) {
|
|
276
276
|
try {
|
|
277
|
-
const parsedParams =
|
|
277
|
+
const parsedParams = route.options.parseParams(routeParams);
|
|
278
278
|
Object.assign(routeParams, parsedParams);
|
|
279
279
|
} catch (err) {
|
|
280
280
|
parsedParamsError = new PathParamError(err.message, {
|
|
@@ -289,13 +289,13 @@ class Router {
|
|
|
289
289
|
return;
|
|
290
290
|
});
|
|
291
291
|
const matches = [];
|
|
292
|
-
matchedRoutes.forEach((
|
|
292
|
+
matchedRoutes.forEach((route, index) => {
|
|
293
293
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
294
294
|
const parentMatch = matches[index - 1];
|
|
295
295
|
const [preMatchSearch, searchError] = (() => {
|
|
296
296
|
const parentSearch = (parentMatch == null ? void 0 : parentMatch.search) ?? locationSearch;
|
|
297
297
|
try {
|
|
298
|
-
const validator = typeof
|
|
298
|
+
const validator = typeof route.options.validateSearch === "object" ? route.options.validateSearch.parse : route.options.validateSearch;
|
|
299
299
|
const search = (validator == null ? void 0 : validator(parentSearch)) ?? {};
|
|
300
300
|
return [
|
|
301
301
|
{
|
|
@@ -314,16 +314,16 @@ class Router {
|
|
|
314
314
|
return [parentSearch, searchParamError];
|
|
315
315
|
}
|
|
316
316
|
})();
|
|
317
|
-
const loaderDeps = ((_b = (_a =
|
|
317
|
+
const loaderDeps = ((_b = (_a = route.options).loaderDeps) == null ? void 0 : _b.call(_a, {
|
|
318
318
|
search: preMatchSearch
|
|
319
319
|
})) ?? "";
|
|
320
320
|
const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : "";
|
|
321
321
|
const interpolatedPath = path.interpolatePath({
|
|
322
|
-
path:
|
|
322
|
+
path: route.fullPath,
|
|
323
323
|
params: routeParams
|
|
324
324
|
});
|
|
325
325
|
const matchId = path.interpolatePath({
|
|
326
|
-
path:
|
|
326
|
+
path: route.id,
|
|
327
327
|
params: routeParams,
|
|
328
328
|
leaveWildcards: true
|
|
329
329
|
}) + loaderDepsHash;
|
|
@@ -337,14 +337,14 @@ class Router {
|
|
|
337
337
|
params: routeParams
|
|
338
338
|
};
|
|
339
339
|
} else {
|
|
340
|
-
const status =
|
|
340
|
+
const status = route.options.loader || route.options.beforeLoad ? "pending" : "success";
|
|
341
341
|
const loadPromise = utils.createControlledPromise();
|
|
342
342
|
if (status === "success") {
|
|
343
343
|
loadPromise.resolve();
|
|
344
344
|
}
|
|
345
345
|
match = {
|
|
346
346
|
id: matchId,
|
|
347
|
-
routeId:
|
|
347
|
+
routeId: route.id,
|
|
348
348
|
params: routeParams,
|
|
349
349
|
pathname: path.joinPaths([this.basepath, interpolatedPath]),
|
|
350
350
|
updatedAt: Date.now(),
|
|
@@ -364,23 +364,23 @@ class Router {
|
|
|
364
364
|
loaderDeps,
|
|
365
365
|
invalid: false,
|
|
366
366
|
preload: false,
|
|
367
|
-
links: (_d = (_c =
|
|
368
|
-
scripts: (_f = (_e =
|
|
369
|
-
staticData:
|
|
367
|
+
links: (_d = (_c = route.options).links) == null ? void 0 : _d.call(_c),
|
|
368
|
+
scripts: (_f = (_e = route.options).scripts) == null ? void 0 : _f.call(_e),
|
|
369
|
+
staticData: route.options.staticData || {}
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
372
|
if (match.status === "success") {
|
|
373
|
-
match.meta = (_h = (_g =
|
|
373
|
+
match.meta = (_h = (_g = route.options).meta) == null ? void 0 : _h.call(_g, {
|
|
374
374
|
matches,
|
|
375
375
|
params: match.params,
|
|
376
376
|
loaderData: match.loaderData
|
|
377
377
|
});
|
|
378
|
-
match.headers = (_j = (_i =
|
|
378
|
+
match.headers = (_j = (_i = route.options).headers) == null ? void 0 : _j.call(_i, {
|
|
379
379
|
loaderData: match.loaderData
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
382
|
if (!(opts == null ? void 0 : opts.preload)) {
|
|
383
|
-
match.globalNotFound = globalNotFoundRouteId ===
|
|
383
|
+
match.globalNotFound = globalNotFoundRouteId === route.id;
|
|
384
384
|
}
|
|
385
385
|
match.search = utils.replaceEqualDeep(match.search, preMatchSearch);
|
|
386
386
|
match.searchError = searchError;
|
|
@@ -743,11 +743,11 @@ class Router {
|
|
|
743
743
|
isFetching: false,
|
|
744
744
|
error: err
|
|
745
745
|
}));
|
|
746
|
-
rendered = true;
|
|
747
746
|
if (!err.routeId) {
|
|
748
747
|
err.routeId = match.routeId;
|
|
749
748
|
}
|
|
750
749
|
if (redirects.isRedirect(err)) {
|
|
750
|
+
rendered = true;
|
|
751
751
|
err = this.resolveRedirect(err);
|
|
752
752
|
throw err;
|
|
753
753
|
} else if (notFound.isNotFound(err)) {
|
|
@@ -764,11 +764,11 @@ class Router {
|
|
|
764
764
|
try {
|
|
765
765
|
for (let [index, match] of matches.entries()) {
|
|
766
766
|
const parentMatch = matches[index - 1];
|
|
767
|
-
const
|
|
767
|
+
const route = this.looseRoutesById[match.routeId];
|
|
768
768
|
const abortController = new AbortController();
|
|
769
769
|
let loadPromise = match.loadPromise;
|
|
770
|
-
const pendingMs =
|
|
771
|
-
const shouldPending = !!(onReady && !this.isServer && !preload && (
|
|
770
|
+
const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;
|
|
771
|
+
const shouldPending = !!(onReady && !this.isServer && !preload && (route.options.loader || route.options.beforeLoad) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? this.options.defaultPendingComponent));
|
|
772
772
|
if (shouldPending) {
|
|
773
773
|
setTimeout(() => {
|
|
774
774
|
try {
|
|
@@ -800,7 +800,7 @@ class Router {
|
|
|
800
800
|
firstBadMatchIndex = firstBadMatchIndex ?? index;
|
|
801
801
|
handleRedirectAndNotFound(match, err);
|
|
802
802
|
try {
|
|
803
|
-
(_b2 = (_a2 =
|
|
803
|
+
(_b2 = (_a2 = route.options).onError) == null ? void 0 : _b2.call(_a2, err);
|
|
804
804
|
} catch (errorHandlerErr) {
|
|
805
805
|
err = errorHandlerErr;
|
|
806
806
|
handleRedirectAndNotFound(match, err);
|
|
@@ -821,7 +821,16 @@ class Router {
|
|
|
821
821
|
}
|
|
822
822
|
try {
|
|
823
823
|
const parentContext = (parentMatch == null ? void 0 : parentMatch.context) ?? this.options.context ?? {};
|
|
824
|
-
|
|
824
|
+
matches[index] = match = updateMatch(match.id, (prev) => ({
|
|
825
|
+
...prev,
|
|
826
|
+
routeContext: utils.replaceEqualDeep(
|
|
827
|
+
match.routeContext,
|
|
828
|
+
parentContext
|
|
829
|
+
),
|
|
830
|
+
context: utils.replaceEqualDeep(match.context, parentContext),
|
|
831
|
+
abortController
|
|
832
|
+
}));
|
|
833
|
+
const beforeLoadContext = await ((_b = (_a = route.options).beforeLoad) == null ? void 0 : _b.call(_a, {
|
|
825
834
|
search: match.search,
|
|
826
835
|
abortController,
|
|
827
836
|
params: match.params,
|
|
@@ -861,7 +870,7 @@ class Router {
|
|
|
861
870
|
validResolvedMatches.forEach((match, index) => {
|
|
862
871
|
const createValidateResolvedMatchPromise = async () => {
|
|
863
872
|
const parentMatchPromise = matchPromises[index - 1];
|
|
864
|
-
const
|
|
873
|
+
const route = this.looseRoutesById[match.routeId];
|
|
865
874
|
const loaderContext = {
|
|
866
875
|
params: match.params,
|
|
867
876
|
deps: match.loaderDeps,
|
|
@@ -872,7 +881,7 @@ class Router {
|
|
|
872
881
|
location,
|
|
873
882
|
navigate: (opts) => this.navigate({ ...opts, from: match.pathname }),
|
|
874
883
|
cause: preload ? "preload" : match.cause,
|
|
875
|
-
route
|
|
884
|
+
route
|
|
876
885
|
};
|
|
877
886
|
const fetch = async () => {
|
|
878
887
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -901,13 +910,13 @@ class Router {
|
|
|
901
910
|
fetchCount: match.fetchCount + 1
|
|
902
911
|
})
|
|
903
912
|
);
|
|
904
|
-
lazyPromise = ((_a2 =
|
|
905
|
-
Object.assign(
|
|
913
|
+
lazyPromise = ((_a2 = route.lazyFn) == null ? void 0 : _a2.call(route).then((lazyRoute) => {
|
|
914
|
+
Object.assign(route.options, lazyRoute.options);
|
|
906
915
|
})) || Promise.resolve();
|
|
907
916
|
componentsPromise = lazyPromise.then(
|
|
908
917
|
() => Promise.all(
|
|
909
918
|
componentTypes.map(async (type) => {
|
|
910
|
-
const component =
|
|
919
|
+
const component = route.options[type];
|
|
911
920
|
if (component == null ? void 0 : component.preload) {
|
|
912
921
|
await component.preload();
|
|
913
922
|
}
|
|
@@ -916,7 +925,7 @@ class Router {
|
|
|
916
925
|
);
|
|
917
926
|
await lazyPromise;
|
|
918
927
|
checkLatest();
|
|
919
|
-
loaderPromise = (_c = (_b2 =
|
|
928
|
+
loaderPromise = (_c = (_b2 = route.options).loader) == null ? void 0 : _c.call(_b2, loaderContext);
|
|
920
929
|
matches[index] = match = updateMatch(
|
|
921
930
|
match.id,
|
|
922
931
|
(prev) => ({
|
|
@@ -930,12 +939,12 @@ class Router {
|
|
|
930
939
|
handleRedirectAndNotFound(match, loaderData);
|
|
931
940
|
await potentialPendingMinPromise();
|
|
932
941
|
checkLatest();
|
|
933
|
-
const meta = (_e = (_d =
|
|
942
|
+
const meta = (_e = (_d = route.options).meta) == null ? void 0 : _e.call(_d, {
|
|
934
943
|
matches,
|
|
935
944
|
params: match.params,
|
|
936
945
|
loaderData
|
|
937
946
|
});
|
|
938
|
-
const headers = (_g = (_f =
|
|
947
|
+
const headers = (_g = (_f = route.options).headers) == null ? void 0 : _g.call(_f, {
|
|
939
948
|
loaderData
|
|
940
949
|
});
|
|
941
950
|
matches[index] = match = updateMatch(match.id, (prev) => ({
|
|
@@ -955,7 +964,7 @@ class Router {
|
|
|
955
964
|
checkLatest();
|
|
956
965
|
handleRedirectAndNotFound(match, e);
|
|
957
966
|
try {
|
|
958
|
-
(_i = (_h =
|
|
967
|
+
(_i = (_h = route.options).onError) == null ? void 0 : _i.call(_h, e);
|
|
959
968
|
} catch (onErrorError) {
|
|
960
969
|
error = onErrorError;
|
|
961
970
|
handleRedirectAndNotFound(match, onErrorError);
|
|
@@ -972,8 +981,8 @@ class Router {
|
|
|
972
981
|
match.loadPromise.resolve();
|
|
973
982
|
};
|
|
974
983
|
const age = Date.now() - match.updatedAt;
|
|
975
|
-
const staleAge = preload ?
|
|
976
|
-
const shouldReloadOption =
|
|
984
|
+
const staleAge = preload ? route.options.preloadStaleTime ?? this.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? this.options.defaultStaleTime ?? 0;
|
|
985
|
+
const shouldReloadOption = route.options.shouldReload;
|
|
977
986
|
const shouldReload = typeof shouldReloadOption === "function" ? shouldReloadOption(loaderContext) : shouldReloadOption;
|
|
978
987
|
matches[index] = match = {
|
|
979
988
|
...match,
|
|
@@ -1015,6 +1024,10 @@ class Router {
|
|
|
1015
1024
|
await triggerOnReady();
|
|
1016
1025
|
} catch (err) {
|
|
1017
1026
|
if (redirects.isRedirect(err) || notFound.isNotFound(err)) {
|
|
1027
|
+
if (notFound.isNotFound(err) && !preload) {
|
|
1028
|
+
console.log("trigger");
|
|
1029
|
+
await triggerOnReady();
|
|
1030
|
+
}
|
|
1018
1031
|
throw err;
|
|
1019
1032
|
}
|
|
1020
1033
|
}
|
|
@@ -1049,11 +1062,11 @@ class Router {
|
|
|
1049
1062
|
return {
|
|
1050
1063
|
...s,
|
|
1051
1064
|
cachedMatches: s.cachedMatches.filter((d) => {
|
|
1052
|
-
const
|
|
1053
|
-
if (!
|
|
1065
|
+
const route = this.looseRoutesById[d.routeId];
|
|
1066
|
+
if (!route.options.loader) {
|
|
1054
1067
|
return false;
|
|
1055
1068
|
}
|
|
1056
|
-
const gcTime = (d.preload ?
|
|
1069
|
+
const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3;
|
|
1057
1070
|
return d.status !== "error" && Date.now() - d.updatedAt < gcTime;
|
|
1058
1071
|
})
|
|
1059
1072
|
};
|
|
@@ -1207,7 +1220,7 @@ class Router {
|
|
|
1207
1220
|
}
|
|
1208
1221
|
invariant(
|
|
1209
1222
|
_ctx,
|
|
1210
|
-
"Expected to find a __TSR_DEHYDRATED__ property on window... but we did not.
|
|
1223
|
+
"Expected to find a __TSR_DEHYDRATED__ property on window... but we did not. Please file an issue!"
|
|
1211
1224
|
);
|
|
1212
1225
|
const ctx = this.options.transformer.parse(_ctx);
|
|
1213
1226
|
this.dehydratedData = ctx.payload;
|
|
@@ -1225,15 +1238,15 @@ class Router {
|
|
|
1225
1238
|
dehydratedMatch,
|
|
1226
1239
|
`Could not find a client-side match for dehydrated match with id: ${match.id}!`
|
|
1227
1240
|
);
|
|
1228
|
-
const
|
|
1241
|
+
const route = this.looseRoutesById[match.routeId];
|
|
1229
1242
|
const assets = dehydratedMatch.status === "notFound" || dehydratedMatch.status === "redirected" ? {} : {
|
|
1230
|
-
meta: (_b2 = (_a2 =
|
|
1243
|
+
meta: (_b2 = (_a2 = route.options).meta) == null ? void 0 : _b2.call(_a2, {
|
|
1231
1244
|
matches: allMatches,
|
|
1232
1245
|
params: match.params,
|
|
1233
1246
|
loaderData: dehydratedMatch.loaderData
|
|
1234
1247
|
}),
|
|
1235
|
-
links: (_d = (_c2 =
|
|
1236
|
-
scripts: (_f = (_e =
|
|
1248
|
+
links: (_d = (_c2 = route.options).links) == null ? void 0 : _d.call(_c2),
|
|
1249
|
+
scripts: (_f = (_e = route.options).scripts) == null ? void 0 : _f.call(_e)
|
|
1237
1250
|
};
|
|
1238
1251
|
return {
|
|
1239
1252
|
...match,
|
|
@@ -1252,8 +1265,8 @@ class Router {
|
|
|
1252
1265
|
const matchesByRouteId = Object.fromEntries(
|
|
1253
1266
|
matches.map((match2) => [match2.routeId, match2])
|
|
1254
1267
|
);
|
|
1255
|
-
let routeCursor = (err.global ? this.looseRoutesById[
|
|
1256
|
-
while (!routeCursor.options.notFoundComponent && !this.options.defaultNotFoundComponent && routeCursor.id !==
|
|
1268
|
+
let routeCursor = (err.global ? this.looseRoutesById[root.rootRouteId] : this.looseRoutesById[err.routeId]) || this.looseRoutesById[root.rootRouteId];
|
|
1269
|
+
while (!routeCursor.options.notFoundComponent && !this.options.defaultNotFoundComponent && routeCursor.id !== root.rootRouteId) {
|
|
1257
1270
|
routeCursor = routeCursor.parentRoute;
|
|
1258
1271
|
invariant(
|
|
1259
1272
|
routeCursor,
|