title: Redirect doesn't redirect to components
body: <p>This is my <code>index.js</code> page</p>
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import Login from './Login';
  import Dashboard from './Dashboard';
  import { BrowserRouter as Router, Route} from 'react-router-dom';
  import './css/bootstrap.min.css';
  import './css/font-awesome.min.css';
  import './css/style.css';
  import { createHistory, useBasename } from 'history'
  
  const history = useBasename(createHistory)({
      basename: '/'
  })   
  
  ReactDOM.render((
    &lt;Router history={history}&gt;
      &lt;div&gt;
         &lt;Route   path=&quot;/&quot; component={Login} /&gt;
         &lt;Route path=&quot;dashboard&quot; component={Dashboard} store={Dashboard} /&gt;
         &lt;Route exact path=&quot;login&quot; component={Login} store={Login} /&gt;
      &lt;/div&gt;
    &lt;/Router&gt;
  ),
    document.getElementById('root')
  );
  </code></pre>
  <p>This is my login page. But clicking on the button doesn't redirect to the corresponding component.</p>
  <pre class="lang-js prettyprint-override"><code>import React, { Component } from 'react';
     
  
  export default class Login extends Component {
  constructor (props){
          super(props);
          this.state = {
              email : '',
              password : '',
              userId : ''
          };
      }
  
      login(){
        //this.props.router.push('/dashboard'); // Its was not working
        this.props.history.push('dashboard'); //Its working for me
      }
   render() {
      return (
      &lt;div className=&quot;container-fluid&quot;&gt;
      &lt;div className=&quot;row&quot;&gt;
          &lt;div className=&quot;col-xl-12&quot;&gt;    
              &lt;div className=&quot;login-page-block-inner&quot;&gt;
                  &lt;div className=&quot;login-page-block-form&quot;&gt;
                          &lt;div className=&quot;form-actions&quot;&gt;
                              &lt;button type=&quot;button&quot;  className=&quot;btn btn-primary width-150&quot; onClick={(e) =&gt; { this.login()} }&gt;Sign In&lt;/button&gt;
                          &lt;/div&gt;                       
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
      );
    }
  }
  </code></pre>