From e15fe48ec8b7911623d6d8979e9886d991d9f9ec Mon Sep 17 00:00:00 2001 From: p-sw Date: Fri, 14 Jun 2024 22:54:32 +0900 Subject: [PATCH] fix: use asChild in drawer components --- packages/react/components/Drawer.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/react/components/Drawer.tsx b/packages/react/components/Drawer.tsx index fbaa187..ed2c86f 100644 --- a/packages/react/components/Drawer.tsx +++ b/packages/react/components/Drawer.tsx @@ -404,8 +404,11 @@ const DrawerHeader = forwardRef( const [variantProps, restPropsCompressed] = resolveDrawerHeaderVariantProps(props); const { asChild, ...restPropsExtracted } = restPropsCompressed; + + const Comp = asChild ? Slot : "div"; + return ( -
((props, ref) => { const [variantProps, restPropsCompressed] = resolveDrawerBodyVariantProps(props); const { asChild, ...restPropsExtracted } = restPropsCompressed; + + const Comp = asChild ? Slot : "div"; + return ( -
( const [variantProps, restPropsCompressed] = resolveDrawerFooterVariantProps(props); const { asChild, ...restPropsExtracted } = restPropsCompressed; + + const Comp = asChild ? Slot : "div"; + return ( -