@tanstack/react-router 1.52.5 → 1.53.1

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/react-router",
3
- "version": "1.52.5",
3
+ "version": "1.53.1",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/Matches.tsx CHANGED
@@ -352,8 +352,8 @@ export function MatchRoute<
352
352
  return params ? props.children : null
353
353
  }
354
354
 
355
- export type MakeRouteMatches<
356
- TRouter extends AnyRouter = AnyRouter,
355
+ export type MakeRouteMatchUnion<
356
+ TRouter extends AnyRouter = RegisteredRouter,
357
357
  TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,
358
358
  > = TRoute extends any
359
359
  ? RouteMatch<
@@ -369,7 +369,7 @@ export type MakeRouteMatches<
369
369
 
370
370
  export function useMatches<
371
371
  TRouter extends AnyRouter = RegisteredRouter,
372
- TRouteMatch = MakeRouteMatches<TRouter>,
372
+ TRouteMatch = MakeRouteMatchUnion<TRouter>,
373
373
  T = Array<TRouteMatch>,
374
374
  >(opts?: { select?: (matches: Array<TRouteMatch>) => T }): T {
375
375
  return useRouterState({
package/src/path.ts CHANGED
@@ -181,7 +181,7 @@ export function parsePathname(pathname?: string): Array<Segment> {
181
181
 
182
182
  return {
183
183
  type: 'pathname',
184
- value: decodeURIComponent(part),
184
+ value: decodeURI(part),
185
185
  }
186
186
  }),
187
187
  )
package/src/route.ts CHANGED
@@ -11,7 +11,7 @@ import { rootRouteId } from './root'
11
11
  import type * as React from 'react'
12
12
  import type { RootRouteId } from './root'
13
13
  import type { UseNavigateResult } from './useNavigate'
14
- import type { MakeRouteMatch, RouteMatch } from './Matches'
14
+ import type { MakeRouteMatch, MakeRouteMatchUnion, RouteMatch } from './Matches'
15
15
  import type { NavigateOptions, ParsePathParams, ToMaskOptions } from './link'
16
16
  import type { ParsedLocation } from './location'
17
17
  import type { RouteById, RouteIds, RoutePaths } from './routeInfo'
@@ -285,6 +285,7 @@ export interface ContextOptions<
285
285
  navigate: NavigateFn
286
286
  buildLocation: BuildLocationFn
287
287
  cause: 'preload' | 'enter' | 'stay'
288
+ matches: Array<MakeRouteMatchUnion>
288
289
  }
289
290
 
290
291
  export interface RouteContextOptions<
package/src/router.ts CHANGED
@@ -1264,6 +1264,7 @@ export class Router<
1264
1264
  cause: match.cause,
1265
1265
  abortController: match.abortController,
1266
1266
  preload: !!match.preload,
1267
+ matches,
1267
1268
  }
1268
1269
 
1269
1270
  // Get the route context
@@ -2080,6 +2081,7 @@ export class Router<
2080
2081
  this.navigate({ ...opts, _fromLocation: location }),
2081
2082
  buildLocation: this.buildLocation,
2082
2083
  cause: preload ? 'preload' : cause,
2084
+ matches,
2083
2085
  }
2084
2086
 
2085
2087
  let beforeLoadContext =