@tanstack/react-router 1.45.0 → 1.45.2

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/src/path.ts CHANGED
@@ -175,7 +175,7 @@ export function parsePathname(pathname?: string): Array<Segment> {
175
175
 
176
176
  return {
177
177
  type: 'pathname',
178
- value: part,
178
+ value: decodeURIComponent(part),
179
179
  }
180
180
  }),
181
181
  )
package/src/router.ts CHANGED
@@ -1855,7 +1855,8 @@ export class Router<
1855
1855
  }
1856
1856
 
1857
1857
  const beforeLoadContext = route.options.beforeLoad
1858
- ? (await route.options.beforeLoad(beforeLoadFnContext)) ?? {}
1858
+ ? ((await route.options.beforeLoad(beforeLoadFnContext)) ??
1859
+ {})
1859
1860
  : {}
1860
1861
 
1861
1862
  checkLatest()
@@ -2068,12 +2069,12 @@ export class Router<
2068
2069
  const age = Date.now() - match.updatedAt
2069
2070
 
2070
2071
  const staleAge = preload
2071
- ? route.options.preloadStaleTime ??
2072
+ ? (route.options.preloadStaleTime ??
2072
2073
  this.options.defaultPreloadStaleTime ??
2073
- 30_000 // 30 seconds for preloads by default
2074
- : route.options.staleTime ??
2074
+ 30_000) // 30 seconds for preloads by default
2075
+ : (route.options.staleTime ??
2075
2076
  this.options.defaultStaleTime ??
2076
- 0
2077
+ 0)
2077
2078
 
2078
2079
  const shouldReloadOption = route.options.shouldReload
2079
2080
 
@@ -2190,8 +2191,9 @@ export class Router<
2190
2191
  // otherwise, use the gcTime
2191
2192
  const gcTime =
2192
2193
  (d.preload
2193
- ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime
2194
- : route.options.gcTime ?? this.options.defaultGcTime) ??
2194
+ ? (route.options.preloadGcTime ??
2195
+ this.options.defaultPreloadGcTime)
2196
+ : (route.options.gcTime ?? this.options.defaultGcTime)) ??
2195
2197
  5 * 60 * 1000
2196
2198
 
2197
2199
  return d.status !== 'error' && Date.now() - d.updatedAt < gcTime