react-router 6.25.1 → 6.26.0-pre.0
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/CHANGELOG.md +15 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/react-router.development.js +14 -3
- package/dist/react-router.development.js.map +1 -1
- package/dist/react-router.production.min.js +2 -2
- package/dist/react-router.production.min.js.map +1 -1
- package/dist/umd/react-router.development.js +20 -5
- package/dist/umd/react-router.development.js.map +1 -1
- package/dist/umd/react-router.production.min.js +2 -2
- package/dist/umd/react-router.production.min.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router v6.
|
|
2
|
+
* React Router v6.26.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -552,7 +552,7 @@
|
|
|
552
552
|
}, children);
|
|
553
553
|
}
|
|
554
554
|
function _renderMatches(matches, parentMatches, dataRouterState, future) {
|
|
555
|
-
var
|
|
555
|
+
var _dataRouterState;
|
|
556
556
|
if (parentMatches === void 0) {
|
|
557
557
|
parentMatches = [];
|
|
558
558
|
}
|
|
@@ -563,11 +563,22 @@
|
|
|
563
563
|
future = null;
|
|
564
564
|
}
|
|
565
565
|
if (matches == null) {
|
|
566
|
-
var
|
|
567
|
-
if (
|
|
566
|
+
var _future;
|
|
567
|
+
if (!dataRouterState) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
if (dataRouterState.errors) {
|
|
568
571
|
// Don't bail if we have data router errors so we can render them in the
|
|
569
572
|
// boundary. Use the pre-matched (or shimmed) matches
|
|
570
573
|
matches = dataRouterState.matches;
|
|
574
|
+
} else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
|
|
575
|
+
// Don't bail if we're initializing with partial hydration and we have
|
|
576
|
+
// router matches. That means we're actively running `patchRoutesOnMiss`
|
|
577
|
+
// so we should render down the partial matches to the appropriate
|
|
578
|
+
// `HydrateFallback`. We only do this if `parentMatches` is empty so it
|
|
579
|
+
// only impacts the root matches for `RouterProvider` and no descendant
|
|
580
|
+
// `<Routes>`
|
|
581
|
+
matches = dataRouterState.matches;
|
|
571
582
|
} else {
|
|
572
583
|
return null;
|
|
573
584
|
}
|
|
@@ -575,7 +586,7 @@
|
|
|
575
586
|
let renderedMatches = matches;
|
|
576
587
|
|
|
577
588
|
// If we have data errors, trim matches to the highest error boundary
|
|
578
|
-
let errors = (
|
|
589
|
+
let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors;
|
|
579
590
|
if (errors != null) {
|
|
580
591
|
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined);
|
|
581
592
|
!(errorIndex >= 0) ? router.UNSAFE_invariant(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : void 0;
|
|
@@ -1522,6 +1533,10 @@
|
|
|
1522
1533
|
enumerable: true,
|
|
1523
1534
|
get: function () { return router.redirectDocument; }
|
|
1524
1535
|
});
|
|
1536
|
+
Object.defineProperty(exports, 'replace', {
|
|
1537
|
+
enumerable: true,
|
|
1538
|
+
get: function () { return router.replace; }
|
|
1539
|
+
});
|
|
1525
1540
|
Object.defineProperty(exports, 'resolvePath', {
|
|
1526
1541
|
enumerable: true,
|
|
1527
1542
|
get: function () { return router.resolvePath; }
|