Skip to content

Commit f313727

Browse files
Fix fromTag types
1 parent f708742 commit f313727

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

public-types/reflect.d.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type {
55
ComponentProps,
66
ComponentType,
77
FC,
8+
JSX,
89
PropsWithChildren,
9-
ReactHTML,
1010
} from 'react';
1111

1212
type UseUnitConfig = Parameters<typeof useUnit>[1];
@@ -239,11 +239,6 @@ export function variant<
239239
): FC<FinalProps<Props, Bind>>;
240240

241241
// fromTag types
242-
type GetProps<HtmlTag extends keyof ReactHTML> = Exclude<
243-
Parameters<ReactHTML[HtmlTag]>[0],
244-
null | undefined
245-
>;
246-
247242
/**
248243
*
249244
* Simple helper to allow to use `reflect` with any valid html tag
@@ -264,6 +259,6 @@ type GetProps<HtmlTag extends keyof ReactHTML> = Exclude<
264259
* })
265260
* ```
266261
*/
267-
export function fromTag<HtmlTag extends keyof ReactHTML>(
262+
export function fromTag<HtmlTag extends keyof JSX.IntrinsicElements>(
268263
htmlTag: HtmlTag,
269-
): FC<PropsWithChildren<GetProps<HtmlTag>>>;
264+
): (props: PropsWithChildren<JSX.IntrinsicElements[HtmlTag]>) => React.ReactNode;

0 commit comments

Comments
 (0)