Browse Source

Merge pull request #1421 from DouyinFE/fix_confirm_modal_destory_div

fix: fix confirm modal destory logic
代强 2 years ago
parent
commit
1c09b194ce
1 changed files with 5 additions and 1 deletions
  1. 5 1
      packages/semi-ui/modal/confirm.tsx

+ 5 - 1
packages/semi-ui/modal/confirm.tsx

@@ -36,7 +36,11 @@ export default function confirm<T>(props: ConfirmProps) {
 
 
     function render(renderProps: ConfirmProps) {
-        ReactDOM.render(<ConfirmModal {...renderProps} motion={props.motion}/>, div);
+        const { afterClose } = renderProps;
+        ReactDOM.render(<ConfirmModal {...renderProps} afterClose={(...args:any)=>{
+            afterClose?.(...args);
+            destroy();
+        }} motion={props.motion}/>, div);
     }
 
     function close() {