Browse Source

fix tagselect bug

jim 8 năm trước cách đây
mục cha
commit
86b9ac0bd8
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/components/TagSelect/index.js

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

@@ -17,8 +17,9 @@ TagSelectOption.isTagSelectOption = true;
 class TagSelect extends Component {
   static getDerivedStateFromProps(nextProps) {
     if ('value' in nextProps && nextProps.value) {
-      this.setState({ value: nextProps.value });
+      return { value: nextProps.value };
     }
+    return null;
   }
 
   state = {