title: How to properly route after form submit in React with Redux app
body: <p>Originally I wanted to refresh/re-fetch items in list component after submitting and close item's editor form component.</p>
  
  <p>Side note: Before introduce redux to project I did route in <code>handleSubmit</code> function right after <code>axios.put(...)</code> and obviously didn't have list refreshed because routing happens before asynchronous call completed.</p>
  
  <p>Following snippets shows how I use arrow function as call back to do routing within promise:</p>
  
  <p>in partDetail.js module</p>
  
  <pre><code>handleSubmit(event){
      event.preventDefault();
    let part =  this.props.part;
    this.props.updatePart(part, ()=&gt;this.props.history.push('/home'));
      return false;
  }
  </code></pre>
  
  <p>in partsActions.js module</p>
  
  <pre><code>export function updatePart(part, routeCallback){
      return function(dispatch) {
          dispatch({type: UPDATE_PART});
          axios.put(`${apiUrl}${part.id}`,part)
              .then(response =&gt; {
                  routeCallback();
                  //dispatch({type: UPDATE_PART_FULFILLED, payload: response.data})
              })
              .catch((error) =&gt; {
                  console.log("updatePart failed submit error: '"+error+"'");
                  dispatch({type: UPDATE_PART_REJECTED, payload: error})
              })
      }
  }
  </code></pre>
  
  <p>But I have strong feeling that's not proper way to route to view on succeed of asynchronous call in React+Redux. Please advise.</p>