소스 검색

fix: TagSelect can't clear value when Form run resetFields (#3031)

kenve 7 년 전
부모
커밋
2f6288b517
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/components/TagSelect/index.js

+ 2 - 2
src/components/TagSelect/index.js

@@ -28,8 +28,8 @@ class TagSelect extends Component {
   }
 
   static getDerivedStateFromProps(nextProps) {
-    if ('value' in nextProps && nextProps.value) {
-      return { value: nextProps.value };
+    if ('value' in nextProps) {
+      return { value: nextProps.value || [] };
     }
     return null;
   }