From 83b0832a7d6d7b55469359e12500404870011d65 Mon Sep 17 00:00:00 2001 From: p-sw Date: Fri, 24 May 2024 22:17:32 +0900 Subject: [PATCH] fix: change children type to plain ReactNode --- packages/react/shared.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/react/shared.tsx b/packages/react/shared.tsx index d8b05b8..05f154b 100644 --- a/packages/react/shared.tsx +++ b/packages/react/shared.tsx @@ -241,7 +241,7 @@ function combinedRef(refs: React.Ref[]) { } interface SlotProps { - children?: Exclude> | string; + children?: React.ReactNode; } export const Slot = React.forwardRef((props, ref) => { const { children, ...slotProps } = props; @@ -254,16 +254,6 @@ export const Slot = React.forwardRef((props, ref) => { } as any); }); -export interface MustAsChild { - children: React.ReactElement< - unknown, - string | React.JSXElementConstructor - >; -} - -export interface OptionalAsChild { - children?: T extends true - ? React.ReactElement> - : React.ReactNode; - asChild?: T; +export interface AsChild { + asChild?: boolean; }