diff --git a/libs/components/src/render/render.tsx b/libs/components/src/render/render.tsx index 663967877..62b701a75 100644 --- a/libs/components/src/render/render.tsx +++ b/libs/components/src/render/render.tsx @@ -5,7 +5,7 @@ import { type JSXOutput, type QwikIntrinsicElements, type Signal, - Slot + Slot, } from "@qwik.dev/core"; // keyof slows the type server a bunch, instead we use the most common fallbacks @@ -19,7 +19,8 @@ export type AllowedFallbacks = | "ul" | "li"; -type RenderInternalProps = { +type RenderInternalProps = +{ /** The default element and types if a render prop is not provided */ fallback: T; /** @@ -29,8 +30,12 @@ type RenderInternalProps = { jsxType?: unknown; movedProps?: Record; -} & QwikIntrinsicElements[T] & - Record<`${string}$`, unknown>; + } & QwikIntrinsicElements[T]; + +type RenderProps< + P extends object = object, + T extends AllowedFallbacks = AllowedFallbacks, +> = RenderInternalProps & P; /** * Creates an object that overrides bind:* props with undefined to prevent them from rendering in the DOM. @@ -60,7 +65,9 @@ function getBindOverrides(props: Record): Record(props: RenderInternalProps): JSXOutput => { +

( + props: RenderProps

, + ): JSXOutput => { const { fallback: _fallback, jsxType: _jsxType,