Skip to content

Commit 8022085

Browse files
committed
fix: Render types
1 parent a951dc9 commit 8022085

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

libs/components/src/render/render.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
type JSXOutput,
66
type QwikIntrinsicElements,
77
type Signal,
8-
Slot
8+
Slot,
99
} from "@qwik.dev/core";
1010

1111
// keyof slows the type server a bunch, instead we use the most common fallbacks
@@ -19,7 +19,8 @@ export type AllowedFallbacks =
1919
| "ul"
2020
| "li";
2121

22-
type RenderInternalProps<T extends AllowedFallbacks> = {
22+
type RenderInternalProps<T extends AllowedFallbacks> =
23+
{
2324
/** The default element and types if a render prop is not provided */
2425
fallback: T;
2526
/**
@@ -29,8 +30,12 @@ type RenderInternalProps<T extends AllowedFallbacks> = {
2930

3031
jsxType?: unknown;
3132
movedProps?: Record<string, unknown>;
32-
} & QwikIntrinsicElements[T] &
33-
Record<`${string}$`, unknown>;
33+
} & QwikIntrinsicElements[T];
34+
35+
type RenderProps<
36+
P extends object = object,
37+
T extends AllowedFallbacks = AllowedFallbacks,
38+
> = RenderInternalProps<T> & P;
3439

3540
/**
3641
* 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<string, unknown>): Record<string, undefi
6065
* Qwik's reactivity tracking while preventing these attributes from appearing in the DOM.
6166
*/
6267
export const Render = component$(
63-
<T extends AllowedFallbacks>(props: RenderInternalProps<T>): JSXOutput => {
68+
<P extends object = object, T extends AllowedFallbacks = AllowedFallbacks>(
69+
props: RenderProps<P | object, T>,
70+
): JSXOutput => {
6471
const {
6572
fallback: _fallback,
6673
jsxType: _jsxType,

0 commit comments

Comments
 (0)