Skip to content

Commit 0d67bdd

Browse files
Merge pull request #36502 from dasjideepak/fix/tanstack-route-types-36415
TanStack: Type story query params from the route's search schema
2 parents 43328dc + f870276 commit 0d67bdd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • code/frameworks/tanstack-react/src/routing

‎code/frameworks/tanstack-react/src/routing/types.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ type StoryRouteSearch<TRoute> =
3737
IsAppRouteTree<TRoute> extends true
3838
? Record<string, unknown>
3939
: TRoute extends FileRoutesByPath[keyof FileRoutesByPath]
40-
? TRoute['preLoaderRoute'] extends { types: { allSearch: infer A } }
40+
? TRoute['preLoaderRoute'] extends { types: { fullSearchSchemaInput: infer A } }
4141
? A
4242
: never
43-
: Record<string, unknown>;
43+
: TRoute extends AnyRoute
44+
? TRoute['types']['fullSearchSchemaInput']
45+
: Record<string, unknown>;
4446

4547
export type StoryRouteFileOptions<TRoute = undefined> =
4648
IsRoute<TRoute> extends true

0 commit comments

Comments
 (0)