diff --git a/src/Popup/index.tsx b/src/Popup/index.tsx index 167a4aa5..079e1c9c 100644 --- a/src/Popup/index.tsx +++ b/src/Popup/index.tsx @@ -121,7 +121,8 @@ const Popup = React.forwardRef((props, ref) => { targetHeight, } = props; - const childNode = typeof popup === 'function' ? popup() : popup; + const childNode = + (open && (typeof popup === 'function' ? popup() : popup)) || null; // We can not remove holder only when motion finished. const isNodeVisible = open || keepDom; @@ -199,6 +200,10 @@ const Popup = React.forwardRef((props, ref) => { miscStyle.pointerEvents = 'none'; } + if (!forceRender && !open) { + return null; + } + return (