Browse Source

fix: some code style

代强 3 years ago
parent
commit
5c8b5d3fa6
1 changed files with 1 additions and 5 deletions
  1. 1 5
      packages/semi-ui/modal/Modal.tsx

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

@@ -277,11 +277,7 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
 
 
     updateState = () => {
     updateState = () => {
         const { visible } = this.props;
         const { visible } = this.props;
-        if (!visible) {
-            this.foundation.toggleDisplayNone(!visible);
-        } else if (visible) {
-            this.foundation.toggleDisplayNone(!visible);
-        }
+        this.foundation.toggleDisplayNone(!visible);
         const shouldRender = this.props.visible || (this.props.keepDOM && (!this.props.lazyRender || this._haveRendered));
         const shouldRender = this.props.visible || (this.props.keepDOM && (!this.props.lazyRender || this._haveRendered));
         this.foundation.setShouldRender(shouldRender);
         this.foundation.setShouldRender(shouldRender);
     };
     };