Skip to content

Commit af673b8

Browse files
authored
fix(router-core): update MatchRoutesFn signature and proper deprecate old usage (#4730)
1 parent 24ba0b7 commit af673b8

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

packages/router-core/src/router.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,12 @@ export type StartTransitionFn = (fn: () => void) => void
625625
export interface MatchRoutesFn {
626626
(
627627
pathname: string,
628-
locationSearch: AnySchema,
628+
locationSearch?: AnySchema,
629629
opts?: MatchRoutesOpts,
630-
): Array<AnyRouteMatch>
630+
): Array<MakeRouteMatchUnion>
631+
/**
632+
* @deprecated use the following signature instead
633+
*/
631634
(next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>
632635
(
633636
pathnameOrNext: string | ParsedLocation,
@@ -1019,15 +1022,6 @@ export class RouterCore<
10191022
return this.routesById as Record<string, AnyRoute>
10201023
}
10211024

1022-
/**
1023-
@deprecated use the following signature instead
1024-
```ts
1025-
matchRoutes (
1026-
next: ParsedLocation,
1027-
opts?: { preload?: boolean; throwOnError?: boolean },
1028-
): Array<AnyRouteMatch>;
1029-
```
1030-
*/
10311025
matchRoutes: MatchRoutesFn = (
10321026
pathnameOrNext: string | ParsedLocation,
10331027
locationSearchOrOpts?: AnySchema | MatchRoutesOpts,

0 commit comments

Comments
 (0)