Skip to content

Commit 553026e

Browse files
committed
fix(router): fix atIndex types
1 parent 252bb22 commit 553026e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/kida-router/src/navigation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
type KeysOf,
33
type ValueOfKey,
44
type ReadableSignal,
5+
type WritableSignal,
56
atIndex,
67
onMount,
78
readonly,
@@ -221,7 +222,7 @@ export function virtualNavigation<const R extends Routes = {}>(
221222
[routerLocation(createLocation(parseHref(initialPath)))]
222223
)
223224
const $activeIndex = signal(0)
224-
const $location = mountable(atIndex($history, $activeIndex))
225+
const $location = mountable(atIndex($history, $activeIndex) as WritableSignal<RouteLocation<R>>)
225226
const go = (steps: number) => {
226227
const newIndex = Math.max(0, Math.min(
227228
$history().length - 1,

0 commit comments

Comments
 (0)