react-router 6.25.1 → 6.26.0-pre.1
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 +22 -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
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router v6.
|
|
2
|
+
* React Router v6.26.0-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_decodePath, UNSAFE_getResolveToMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, UNSAFE_convertRouteMatchToUiMatch, stripBasename, IDLE_BLOCKER, isRouteErrorResponse, createMemoryHistory, AbortedDeferredError, createRouter } from '@remix-run/router';
|
|
13
|
-
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath } from '@remix-run/router';
|
|
13
|
+
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from '@remix-run/router';
|
|
14
14
|
|
|
15
15
|
const DataRouterContext = /*#__PURE__*/React.createContext(null);
|
|
16
16
|
{
|
|
@@ -479,10 +479,21 @@ function RenderedRoute({
|
|
|
479
479
|
}
|
|
480
480
|
function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null) {
|
|
481
481
|
if (matches == null) {
|
|
482
|
-
if (dataRouterState
|
|
482
|
+
if (!dataRouterState) {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
if (dataRouterState.errors) {
|
|
483
486
|
// Don't bail if we have data router errors so we can render them in the
|
|
484
487
|
// boundary. Use the pre-matched (or shimmed) matches
|
|
485
488
|
matches = dataRouterState.matches;
|
|
489
|
+
} else if (future?.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
|
|
490
|
+
// Don't bail if we're initializing with partial hydration and we have
|
|
491
|
+
// router matches. That means we're actively running `patchRoutesOnMiss`
|
|
492
|
+
// so we should render down the partial matches to the appropriate
|
|
493
|
+
// `HydrateFallback`. We only do this if `parentMatches` is empty so it
|
|
494
|
+
// only impacts the root matches for `RouterProvider` and no descendant
|
|
495
|
+
// `<Routes>`
|
|
496
|
+
matches = dataRouterState.matches;
|
|
486
497
|
} else {
|
|
487
498
|
return null;
|
|
488
499
|
}
|