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