@tanstack/router-core 1.131.27 → 1.131.28
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/router.cjs +15 -22
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/router.js +15 -22
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +31 -36
package/dist/cjs/router.cjs
CHANGED
|
@@ -237,30 +237,23 @@ class RouterCore {
|
|
|
237
237
|
_buildLocation: true
|
|
238
238
|
});
|
|
239
239
|
const lastMatch = utils.last(allCurrentLocationMatches);
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return comparePaths(d.fullPath, fromPath);
|
|
254
|
-
});
|
|
255
|
-
const matchedCurrent = utils.findLast(allFromMatches, (d) => {
|
|
256
|
-
return comparePaths(d.fullPath, currentLocation.pathname);
|
|
257
|
-
});
|
|
258
|
-
if (!matchedFrom && !matchedCurrent) {
|
|
259
|
-
console.warn(`Could not find match for from: ${fromPath}`);
|
|
260
|
-
}
|
|
240
|
+
if (dest.from && process.env.NODE_ENV !== "production" && dest._isNavigate) {
|
|
241
|
+
const allFromMatches = this.getMatchedRoutes(
|
|
242
|
+
dest.from,
|
|
243
|
+
void 0
|
|
244
|
+
).matchedRoutes;
|
|
245
|
+
const matchedFrom = utils.findLast(allCurrentLocationMatches, (d) => {
|
|
246
|
+
return comparePaths(d.fullPath, dest.from);
|
|
247
|
+
});
|
|
248
|
+
const matchedCurrent = utils.findLast(allFromMatches, (d) => {
|
|
249
|
+
return comparePaths(d.fullPath, lastMatch.fullPath);
|
|
250
|
+
});
|
|
251
|
+
if (!matchedFrom && !matchedCurrent) {
|
|
252
|
+
console.warn(`Could not find match for from: ${dest.from}`);
|
|
261
253
|
}
|
|
262
254
|
}
|
|
263
|
-
|
|
255
|
+
const defaultedFromPath = dest.unsafeRelative === "path" ? currentLocation.pathname : dest.from ?? lastMatch.fullPath;
|
|
256
|
+
const fromPath = this.resolvePathWithBase(defaultedFromPath, ".");
|
|
264
257
|
const fromSearch = lastMatch.search;
|
|
265
258
|
const fromParams = { ...lastMatch.params };
|
|
266
259
|
const nextTo = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(fromPath, ".");
|