Skip to content

Commit f4c3e02

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

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

libs/components/src/render/render.tsx

Lines changed: 13 additions & 13 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,15 +65,10 @@ 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 => {
64-
const {
65-
fallback: _fallback,
66-
jsxType: _jsxType,
67-
movedProps,
68-
internalRef: _internalRef,
69-
...rest
70-
} = props;
71-
68+
<P extends object = object, T extends AllowedFallbacks = AllowedFallbacks>(
69+
props: RenderProps<P | object, T>,
70+
): JSXOutput => {
71+
const { movedProps, ...rest } = props;
7272
const Comp = (props.jsxType ?? props.fallback) as Component;
7373

7474
const restOverrides = getBindOverrides(rest);

0 commit comments

Comments
 (0)