diff --git a/packages/react/components/Dialog/Component.tsx b/packages/react/components/Dialog/Component.tsx index 2695ce3..1b135c1 100644 --- a/packages/react/components/Dialog/Component.tsx +++ b/packages/react/components/Dialog/Component.tsx @@ -95,30 +95,32 @@ const DialogOverlay = React.forwardRef( return ( - {ReactDOM.createPortal( -
{ - if (closeOnClick) { - setContext((p) => ({ ...p, opened: false })); - } - onClick?.(e); - }} - > + {() => + ReactDOM.createPortal(
{ + if (closeOnClick) { + setContext((p) => ({ ...p, opened: false })); + } + onClick?.(e); + }} > - {/* Layer for overflow positioning */} - {children} -
-
, - document.body, - )} +
+ {/* Layer for overflow positioning */} + {children} +
+ , + document.body, + ) + }
); }, diff --git a/packages/react/components/Drawer.tsx b/packages/react/components/Drawer.tsx index 42d84f3..f2e3925 100644 --- a/packages/react/components/Drawer.tsx +++ b/packages/react/components/Drawer.tsx @@ -127,23 +127,25 @@ const DrawerOverlay = forwardRef( return ( - {createPortal( - , - document.body, - )} + {() => + createPortal( + , + document.body, + ) + } ); },