@tanstack/react-router 1.89.2 → 1.90.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/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/router.cjs +2 -2
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +2 -2
- package/dist/cjs/useBlocker.cjs +111 -23
- package/dist/cjs/useBlocker.cjs.map +1 -1
- package/dist/cjs/useBlocker.d.cts +58 -13
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/router.d.ts +2 -2
- package/dist/esm/router.js +2 -2
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/useBlocker.d.ts +58 -13
- package/dist/esm/useBlocker.js +111 -23
- package/dist/esm/useBlocker.js.map +1 -1
- package/package.json +2 -2
- package/src/index.tsx +1 -0
- package/src/router.ts +2 -1
- package/src/useBlocker.tsx +245 -41
package/dist/cjs/index.d.cts
CHANGED
|
@@ -43,6 +43,7 @@ export { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifyS
|
|
|
43
43
|
export type { SearchSerializer, SearchParser } from './searchParams.cjs';
|
|
44
44
|
export { defaultTransformer } from './transformer.cjs';
|
|
45
45
|
export type { RouterTransformer, TransformerParse, TransformerStringify, DefaultTransformerParse, DefaultTransformerStringify, } from './transformer.cjs';
|
|
46
|
+
export type { UseBlockerOpts, ShouldBlockFn } from './useBlocker.cjs';
|
|
46
47
|
export { useBlocker, Block } from './useBlocker.cjs';
|
|
47
48
|
export { useNavigate, Navigate } from './useNavigate.cjs';
|
|
48
49
|
export type { UseNavigateResult } from './useNavigate.cjs';
|
package/dist/cjs/router.cjs
CHANGED
|
@@ -218,7 +218,7 @@ class Router {
|
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
};
|
|
221
|
-
this.parseLocation = (previousLocation) => {
|
|
221
|
+
this.parseLocation = (previousLocation, locationToParse) => {
|
|
222
222
|
const parse = ({
|
|
223
223
|
pathname,
|
|
224
224
|
search,
|
|
@@ -236,7 +236,7 @@ class Router {
|
|
|
236
236
|
state: utils.replaceEqualDeep(previousLocation == null ? void 0 : previousLocation.state, state)
|
|
237
237
|
};
|
|
238
238
|
};
|
|
239
|
-
const location = parse(this.history.location);
|
|
239
|
+
const location = parse(locationToParse ?? this.history.location);
|
|
240
240
|
const { __tempLocation, __tempKey } = location.state;
|
|
241
241
|
if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {
|
|
242
242
|
const parsedTempLocation = parse(__tempLocation);
|