Skip to content

Commit a05b6f2

Browse files
committed
fix: type error when passing number to Link.params
for some reason the type error isn't reproducible in `TanStack/router` repo. to check that the changes work: 1. create an external repo (e.g vite tanstack router template) 2. build packages with the changes 3. locally install router packages
1 parent 410fdf8 commit a05b6f2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/router-core/src/link.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,16 @@ export interface MakeRequiredPathParams<
574574
in out TFrom,
575575
in out TTo,
576576
> {
577-
params: MakeRequiredParamsReducer<TRouter, 'PATH', TFrom, TTo> & {}
577+
params: MakeRequiredParamsReducer<
578+
TRouter,
579+
'PATH',
580+
TFrom,
581+
TTo
582+
> extends infer Params
583+
? {
584+
[K in keyof Params]: Params[K] | number
585+
} & {}
586+
: never
578587
}
579588

580589
export interface MakeRequiredSearchParams<

0 commit comments

Comments
 (0)