title: How to push to History in React Router v4?
body: <p>In the current version of React Router (v3) I can accept a server response and use <code>browserHistory.push</code> to go to the appropriate response page. However, this isn't available in v4, and I'm not sure what the appropriate way to handle this is.</p>
  
  <p>In this example, using Redux, <em>components/app-product-form.js</em> calls <code>this.props.addProduct(props)</code> when a user submits the form. When the server returns a success, the user is taken to the Cart page.</p>
  
  <pre><code>// actions/index.js
  export function addProduct(props) {
    return dispatch =&gt;
      axios.post(`${ROOT_URL}/cart`, props, config)
        .then(response =&gt; {
          dispatch({ type: types.AUTH_USER });
          localStorage.setItem('token', response.data.token);
          browserHistory.push('/cart'); // no longer in React Router V4
        });
  }
  </code></pre>
  
  <p>How can I make a redirect to the Cart page from function for React Router v4?</p>