@tanstack/router-core 1.121.39 → 1.122.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/router-core",
3
- "version": "1.121.39",
3
+ "version": "1.122.0",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -187,6 +187,7 @@ export type {
187
187
  RouteContextOptions,
188
188
  BeforeLoadContextOptions,
189
189
  RootRouteOptions,
190
+ RootRouteOptionsExtensions,
190
191
  UpdatableRouteOptionsExtensions,
191
192
  RouteConstraints,
192
193
  RouteTypesById,
package/src/route.ts CHANGED
@@ -1205,6 +1205,13 @@ export interface LoaderFnContext<
1205
1205
  route: AnyRoute
1206
1206
  }
1207
1207
 
1208
+ export interface DefaultRootRouteOptionsExtensions {
1209
+ shellComponent?: unknown
1210
+ }
1211
+
1212
+ export interface RootRouteOptionsExtensions
1213
+ extends DefaultRootRouteOptionsExtensions {}
1214
+
1208
1215
  export type RootRouteOptions<
1209
1216
  TSearchValidator = undefined,
1210
1217
  TRouterContext = {},
@@ -1234,7 +1241,8 @@ export type RootRouteOptions<
1234
1241
  | 'parseParams'
1235
1242
  | 'stringifyParams'
1236
1243
  | 'params'
1237
- >
1244
+ > &
1245
+ RootRouteOptionsExtensions
1238
1246
 
1239
1247
  export type RouteConstraints = {
1240
1248
  TParentRoute: AnyRoute
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
  }