title: Redirect on successful form submission
body: <p>I am trying to implement a simple form logic for educational purposes. I am stuck trying to redirect to url on form submission. Here are relevant sections of my code;</p>
  
  <p><code>index.js</code></p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import App from './App';
  import './index.css';
  
  import { createStore, combineReducers, applyMiddleware  } from 'redux'
  import { Provider } from 'react-redux'
  import { Router, Route, IndexRoute, hashHistory } from 'react-router'
  import { syncHistoryWithStore, routerReducer, routerMiddleware } from 'react-router-redux'
  import { reducer as formReducer } from 'redux-form'
  
  import {Home, Foo, Bar} from './components'
  import {YirtibatLoginForm as LoginForm} from './containers/LoginForm'
  
  import * as reducers from './reducers'
  
  const reducer = combineReducers({
          ...reducers,
      routing: routerReducer,
      form: formReducer
  })
  
  const middleware = routerMiddleware(hashHistory)
  
  const store = createStore(reducer, applyMiddleware(middleware))
  const history = syncHistoryWithStore(hashHistory, store)
  
  
  
  ReactDOM.render(
    &lt;Provider store={store}&gt;
      &lt;Router history={history}&gt;
          &lt;Route path="/" component={App}&gt;
              &lt;IndexRoute component={Home} /&gt;
              &lt;Route path="foo" component={Foo} /&gt;
              &lt;Route path="bar" component={Bar} /&gt;
              &lt;Route path="login" component={LoginForm} /&gt;
          &lt;/Route&gt;
      &lt;/Router&gt;
    &lt;/Provider&gt;,
    document.getElementById('root')
  );
  </code></pre>
  
  <p><code>containers/LoginForm.js</code></p>
  
  <pre><code>import React, { Component } from 'react';
  
  import { connect } from 'react-redux'
  import { push } from 'react-router'
  
  import LoginForm from '../components/LoginForm'
  
  export class BaseYirtibatLoginForm extends Component {
      constructor() {
          super();
  
          this.handlesubmit = this.handlesubmit.bind(this);
      }
  
      handlesubmit(ev) {
          this.props.submitting();
  
          fetch('/login', {
              method:'POST',
              body:JSON.stringify(ev)
          }).then(resp =&gt; {
              if(!resp.ok) {
                  throw new Error(resp.statusText)
              }
              return resp.json()
          }).then( resjson =&gt; {
              this.props.submitsuccess(resjson)
          }).catch(err =&gt; {
              this.props.submiterror(err);
          })
      }
  
      render() {
          return (
              &lt;LoginForm onSubmit={this.handlesubmit} /&gt;
          );
      }
  }
  
  const mapStateToProps = (state) =&gt; {return {}}
  const mapDispatchToProps = (dispatch) =&gt; {
      return {
          submitting: () =&gt; dispatch({type:'submitting'}),
          submitsuccess: (data) =&gt; push("/success"),
          submiterror: (err) =&gt; push("/error")
      }
  }
  
  export const YirtibatLoginForm = connect(mapStateToProps, mapDispatchToProps)(BaseYirtibatLoginForm);
  </code></pre>
  
  <p>I think this code supposed to redirect hash url after the form has been submitted. However I am getting following error in browser console;</p>
  
  <pre><code>Uncaught (in promise) TypeError: (0 , _reactRouter.push) is not a function
      at Object.submiterror (LoginForm.js:45)
      at LoginForm.js:29
  submiterror @ LoginForm.js:45
  (anonymous) @ LoginForm.js:29
  </code></pre>
  
  <p>What is the prefered method to redirect to a route component after for submission events?</p>