Parcourir la source

fix tagselect bug

jim il y a 7 ans
Parent
commit
86b9ac0bd8
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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 {
 class TagSelect extends Component {
   static getDerivedStateFromProps(nextProps) {
   static getDerivedStateFromProps(nextProps) {
     if ('value' in nextProps && nextProps.value) {
     if ('value' in nextProps && nextProps.value) {
-      this.setState({ value: nextProps.value });
+      return { value: nextProps.value };
     }
     }
+    return null;
   }
   }
 
 
   state = {
   state = {