react-router-dom-v5-compat 6.21.1 → 6.21.2-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 +8 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/umd/react-router-dom-v5-compat.development.js +8 -2
- package/dist/umd/react-router-dom-v5-compat.development.js.map +1 -1
- package/dist/umd/react-router-dom-v5-compat.production.min.js +2 -2
- package/dist/umd/react-router-dom-v5-compat.production.min.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router DOM v5 Compat v6.21.
|
|
2
|
+
* React Router DOM v5 Compat v6.21.2-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -330,6 +330,8 @@ const START_TRANSITION = "startTransition";
|
|
|
330
330
|
const startTransitionImpl = React[START_TRANSITION];
|
|
331
331
|
const FLUSH_SYNC = "flushSync";
|
|
332
332
|
const flushSyncImpl = ReactDOM[FLUSH_SYNC];
|
|
333
|
+
const USE_ID = "useId";
|
|
334
|
+
const useIdImpl = React[USE_ID];
|
|
333
335
|
function startTransitionSafe(cb) {
|
|
334
336
|
if (startTransitionImpl) {
|
|
335
337
|
startTransitionImpl(cb);
|
|
@@ -1135,10 +1137,14 @@ function useFetcher(_temp3) {
|
|
|
1135
1137
|
!route ? process.env.NODE_ENV !== "production" ? UNSAFE_invariant(false, "useFetcher must be used inside a RouteContext") : UNSAFE_invariant(false) : void 0;
|
|
1136
1138
|
!(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;
|
|
1137
1139
|
// Fetcher key handling
|
|
1138
|
-
|
|
1140
|
+
// OK to call conditionally to feature detect `useId`
|
|
1141
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1142
|
+
let defaultKey = useIdImpl ? useIdImpl() : "";
|
|
1143
|
+
let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey);
|
|
1139
1144
|
if (key && key !== fetcherKey) {
|
|
1140
1145
|
setFetcherKey(key);
|
|
1141
1146
|
} else if (!fetcherKey) {
|
|
1147
|
+
// We will only fall through here when `useId` is not available
|
|
1142
1148
|
setFetcherKey(getUniqueFetcherId());
|
|
1143
1149
|
}
|
|
1144
1150
|
// Registration/cleanup
|