@tanstack/router-core 1.121.39 → 1.121.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/router-core",
3
- "version": "1.121.39",
3
+ "version": "1.121.40",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/router.ts CHANGED
@@ -1790,8 +1790,15 @@ export class RouterCore<
1790
1790
  location: this.latestLocation,
1791
1791
  pendingMatches,
1792
1792
  // If a cached moved to pendingMatches, remove it from cachedMatches
1793
- cachedMatches: s.cachedMatches.filter((d) => {
1794
- return !pendingMatches.find((e) => e.id === d.id)
1793
+ cachedMatches: s.cachedMatches.filter((cachedMatch) => {
1794
+ const pendingMatch = pendingMatches.find((e) => e.id === cachedMatch.id)
1795
+
1796
+ if (!pendingMatch) return true
1797
+
1798
+ return (
1799
+ cachedMatch.status === 'success' &&
1800
+ (cachedMatch.isFetching || cachedMatch.loaderData !== undefined)
1801
+ )
1795
1802
  }),
1796
1803
  }))
1797
1804
  }