react-router-dom 0.0.0-experimental-8bb3ffdf → 0.0.0-experimental-d90c8fb3
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 +21 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/react-router-dom.development.js +13 -3
- package/dist/react-router-dom.development.js.map +1 -1
- package/dist/react-router-dom.production.min.js +2 -2
- package/dist/react-router-dom.production.min.js.map +1 -1
- package/dist/umd/react-router-dom.development.js +13 -3
- package/dist/umd/react-router-dom.development.js.map +1 -1
- package/dist/umd/react-router-dom.production.min.js +2 -2
- package/dist/umd/react-router-dom.production.min.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# `react-router-dom`
|
|
2
2
|
|
|
3
|
+
## 6.21.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Leverage `useId` for internal fetcher keys when available ([#11166](https://github.com/remix-run/react-router/pull/11166))
|
|
8
|
+
- Updated dependencies:
|
|
9
|
+
- `@remix-run/router@1.14.2`
|
|
10
|
+
- `react-router@6.21.2`
|
|
11
|
+
|
|
12
|
+
## 6.21.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies:
|
|
17
|
+
- `react-router@6.21.1`
|
|
18
|
+
- `@remix-run/router@1.14.1`
|
|
19
|
+
|
|
3
20
|
## 6.21.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -108,7 +125,7 @@
|
|
|
108
125
|
<BrowserRouter>
|
|
109
126
|
<Routes>
|
|
110
127
|
<Route path="dashboard">
|
|
111
|
-
<Route path="*" element={<Dashboard />} />
|
|
128
|
+
<Route index path="*" element={<Dashboard />} />
|
|
112
129
|
</Route>
|
|
113
130
|
</Routes>
|
|
114
131
|
</BrowserRouter>
|
|
@@ -145,7 +162,7 @@
|
|
|
145
162
|
|
|
146
163
|
### Patch Changes
|
|
147
164
|
|
|
148
|
-
- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329). We plan to re-introduce this fix behind a future flag in the next minor version. ([#11078](https://github.com/remix-run/react-router/pull/11078))
|
|
165
|
+
- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see <https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329>). We plan to re-introduce this fix behind a future flag in the next minor version. ([#11078](https://github.com/remix-run/react-router/pull/11078))
|
|
149
166
|
- Updated dependencies:
|
|
150
167
|
- `react-router@6.20.1`
|
|
151
168
|
- `@remix-run/router@1.13.1`
|
|
@@ -400,7 +417,7 @@
|
|
|
400
417
|
|
|
401
418
|
## 6.12.1
|
|
402
419
|
|
|
403
|
-
> [!WARNING]
|
|
420
|
+
> \[!WARNING]
|
|
404
421
|
> Please use version `6.13.0` or later instead of `6.12.1`. This version suffers from a `webpack`/`terser` minification issue resulting in invalid minified code in your resulting production bundles which can cause issues in your application. See [#10579](https://github.com/remix-run/react-router/issues/10579) for more details.
|
|
405
422
|
|
|
406
423
|
### Patch Changes
|
|
@@ -735,7 +752,7 @@
|
|
|
735
752
|
|
|
736
753
|
## 6.4.0
|
|
737
754
|
|
|
738
|
-
Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs]
|
|
755
|
+
Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial).
|
|
739
756
|
|
|
740
757
|
**New APIs**
|
|
741
758
|
|
|
@@ -761,7 +778,3 @@ Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs ov
|
|
|
761
778
|
**Updated Dependencies**
|
|
762
779
|
|
|
763
780
|
- `react-router@6.4.0`
|
|
764
|
-
|
|
765
|
-
[rr-docs]: https://reactrouter.com
|
|
766
|
-
[rr-feature-overview]: https://reactrouter.com/start/overview
|
|
767
|
-
[rr-tutorial]: https://reactrouter.com/start/tutorial
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { SubmitOptions, ParamKeyValuePair, URLSearchParamsInit, SubmitTarge
|
|
|
9
9
|
import { createSearchParams } from "./dom";
|
|
10
10
|
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, ParamKeyValuePair, SubmitOptions, URLSearchParamsInit, V7_FormMethod, };
|
|
11
11
|
export { createSearchParams };
|
|
12
|
-
export type { ActionFunction, ActionFunctionArgs, AwaitProps,
|
|
12
|
+
export type { ActionFunction, ActionFunctionArgs, AwaitProps, Blocker, BlockerFunction, DataRouteMatch, DataRouteObject, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LazyRouteFunction, LayoutRouteProps, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, Params, ParamParseKey, Path, PathMatch, Pathname, PathParam, PathPattern, PathRouteProps, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, } from "react-router";
|
|
13
13
|
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, defer, isRouteErrorResponse, generatePath, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, } from "react-router";
|
|
14
14
|
/** @internal */
|
|
15
15
|
export { UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_NavigationContext, UNSAFE_LocationContext, UNSAFE_RouteContext, UNSAFE_useRouteId, } from "react-router";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router DOM v0.0.0-experimental-
|
|
2
|
+
* React Router DOM v0.0.0-experimental-d90c8fb3
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -328,6 +328,8 @@ const START_TRANSITION = "startTransition";
|
|
|
328
328
|
const startTransitionImpl = React[START_TRANSITION];
|
|
329
329
|
const FLUSH_SYNC = "flushSync";
|
|
330
330
|
const flushSyncImpl = ReactDOM[FLUSH_SYNC];
|
|
331
|
+
const USE_ID = "useId";
|
|
332
|
+
const useIdImpl = React[USE_ID];
|
|
331
333
|
function startTransitionSafe(cb) {
|
|
332
334
|
if (startTransitionImpl) {
|
|
333
335
|
startTransitionImpl(cb);
|
|
@@ -796,7 +798,8 @@ const NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref8, ref
|
|
|
796
798
|
let location = useLocation();
|
|
797
799
|
let routerState = React.useContext(UNSAFE_DataRouterStateContext);
|
|
798
800
|
let {
|
|
799
|
-
navigator
|
|
801
|
+
navigator,
|
|
802
|
+
basename
|
|
800
803
|
} = React.useContext(UNSAFE_NavigationContext);
|
|
801
804
|
let isTransitioning = routerState != null &&
|
|
802
805
|
// Conditional usage is OK here because the usage of a data router is static
|
|
@@ -810,6 +813,9 @@ const NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref8, ref
|
|
|
810
813
|
nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
|
|
811
814
|
toPathname = toPathname.toLowerCase();
|
|
812
815
|
}
|
|
816
|
+
if (nextLocationPathname && basename) {
|
|
817
|
+
nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;
|
|
818
|
+
}
|
|
813
819
|
// If the `to` has a trailing slash, look at that exact spot. Otherwise,
|
|
814
820
|
// we're looking for a slash _after_ what's in `to`. For example:
|
|
815
821
|
//
|
|
@@ -1133,10 +1139,14 @@ function useFetcher(_temp3) {
|
|
|
1133
1139
|
!route ? process.env.NODE_ENV !== "production" ? UNSAFE_invariant(false, "useFetcher must be used inside a RouteContext") : UNSAFE_invariant(false) : void 0;
|
|
1134
1140
|
!(routeId != null) ? process.env.NODE_ENV !== "production" ? UNSAFE_invariant(false, "useFetcher can only be used on routes that contain a unique \"id\"") : UNSAFE_invariant(false) : void 0;
|
|
1135
1141
|
// Fetcher key handling
|
|
1136
|
-
|
|
1142
|
+
// OK to call conditionally to feature detect `useId`
|
|
1143
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1144
|
+
let defaultKey = useIdImpl ? useIdImpl() : "";
|
|
1145
|
+
let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey);
|
|
1137
1146
|
if (key && key !== fetcherKey) {
|
|
1138
1147
|
setFetcherKey(key);
|
|
1139
1148
|
} else if (!fetcherKey) {
|
|
1149
|
+
// We will only fall through here when `useId` is not available
|
|
1140
1150
|
setFetcherKey(getUniqueFetcherId());
|
|
1141
1151
|
}
|
|
1142
1152
|
// Registration/cleanup
|