title: How to clear fields after callback from axios?
body: <p>I have modal component with form. I want to inform fields of this form that form data was successfully sent to database and clear its fields.</p>
  
  <p>Component code: </p>
  
  <pre><code>//ItemModal.js
  
  addItem(e) {
      e.preventDefault();
      const item = {
        id: this.props.itemsStore.length + 1,
        image: this.fileInput.files[0] || 'http://via.placeholder.com/350x150',
        tags: this.tagInput.value,
        place: this.placeInput.value,
        details: this.detailsInput.value
      }
      console.log('addded', item);
      this.props.onAddItem(item);
      this.fileInput.value = '';
      this.tagInput.value = '';
      this.placeInput.value = '';
      this.detailsInput.value = '';
      this.setState({
        filled: { 
          ...this.state.filled, 
          place: false, 
          tags: false 
        },
        loadingText: 'Loading...'
      });
    }
  </code></pre>
  
  <p>...</p>
  
  <pre><code>render() {
      return (
              &lt;div className="text-center" &gt; 
              &lt;div className={"text-center form-notification " + ((this.state.loadingText) ? 'form-notification__active' : '' )}&gt;
                {(this.state.loadingText) ? ((this.props.loadingState === true) ? 'Item added' : this.state.loadingText) : '' }
              &lt;/div&gt;
      )
  }
  </code></pre>
  
  <p>action.js</p>
  
  <pre><code>export function onAddItem(item) {
            axios.post('http://localhost:3001/api/items/', item )
              .then(res =&gt; {
                dispatch({type:"ADD_ITEM", item});
                dispatch({type:"ITEM_LOADED", status: true});
              })
  }
  </code></pre>
  
  <p>helper.js</p>
  
  <pre><code>else if (action.type === 'ITEM_LOADED') {
      const status = action.status;
      return {
        ...state,
        isItemLoaded: status
      }
    } 
  </code></pre>
  
  <p>Currently I have few issues with my code:
  1. field are clearing right after click, but they should clear after changing state of <code>loadingState</code>. I tried to check it in separate function on in componentWillReceiveProps whether state is changed and it worked, but I faces another problem, that after closing this modal there were errors, that such fields doesn't exist.
  2. <code>loadingText</code> should become <code>''</code> (empty) after few seconds. Tried same approach with separate function and componentWillReceiveProps as at first issue.</p>