diff --git a/packages/keyed/src/index.ts b/packages/keyed/src/index.ts index 585139ba3..342a86795 100644 --- a/packages/keyed/src/index.ts +++ b/packages/keyed/src/index.ts @@ -176,10 +176,14 @@ export function Key(props: { * * @see https://github.com/solidjs-community/solid-primitives/tree/main/packages/keyed#Entries */ -export function Entries(props: { - of: Record | ArrayLike | undefined | null | false; +export function Entries(props: { + of: Record | ArrayLike | undefined | null | false; fallback?: JSX.Element; - children: (key: string, v: Accessor, i: Accessor) => JSX.Element; + children: ( + key: K extends number ? string : K, + v: Accessor, + i: Accessor, + ) => JSX.Element; }): JSX.Element { const mapFn = props.children; return createMemo( @@ -191,7 +195,7 @@ export function Entries(props: { key, () => props.of![key as never], ) - : (key, i) => mapFn(key, () => props.of![key as never], i), + : (key, i) => mapFn(key as never, () => props.of![key as never], i), "fallback" in props ? { fallback: () => props.fallback } : undefined, ), ) as unknown as JSX.Element;