title: props.history.push() doesn't redirect
body: <p>props.history.push("/") doesn't redirect. </p>
  
  <p>I did search for solution for this problem and can't find where is the problem and that drives me crazy. </p>
  
  <p>index.js</p>
  
  <pre><code>import 'bootstrap/dist/css/bootstrap.css';
  import 'bootstrap/dist/css/bootstrap-theme.css';
  import './index.css';
  import React from 'react';
  import ReactDOM from 'react-dom';
  import { Provider } from 'react-redux';
  import { ConnectedRouter } from 'react-router-redux';
  import { createBrowserHistory } from 'history';
  import configureStore from './store/configureStore';
  import App from './App';
  //import registerServiceWorker from './registerServiceWorker';
  
  // Create browser history to use in the Redux store
  const baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');
  const history = createBrowserHistory({ basename: baseUrl });
  
  // Get the application-wide store instance, prepopulating with state from the server where available.
  const initialState = window.initialReduxState;
  const store = configureStore(history, initialState);
  
  
  
  //Render app on  "root" &lt;div&gt; in index.html 
  ReactDOM.render(
    &lt;Provider store={store}&gt;
      &lt;ConnectedRouter history={history}&gt;
          &lt;App /&gt;         
      &lt;/ConnectedRouter&gt;
    &lt;/Provider&gt;,
      document.getElementById('root'));
  
  //registerServiceWorker();
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>import React from 'react';
  import { Route, Switch } from 'react-router';
  import Home from './components/Home';
  import Login from './components/Login/Login';
  import Counter from './components/Counter';
  import FetchData from './components/FetchData';
  import { PrivateRoute } from './components/PrivateRoutes/PrivateRoute';
  
  const App = (props) =&gt; {
  
  
      return (
          &lt;Switch&gt;
              &lt;Route path="/login" component={Login}/&gt;
              &lt;PrivateRoute path="/" component={Home} /&gt;
              &lt;Route path='/counter' component={Counter} /&gt;
              &lt;Route path='/fetchdata/:startDateIndex?' component={FetchData} /&gt;
          &lt;/Switch&gt;
          );
  }
  
  export default App;
  </code></pre>
  
  <p>Login.js</p>
  
  <pre><code>import React, { useState } from 'react';
  import { withRouter, Redirect, history } from 'react-router-dom'
  import { Form, Label, FormGroup, FormControl, Button } from 'react-bootstrap';
  import Home from '../Home';
  
  
  //Login user
  function LoginUser(username, password, callback) {
      console.log("Atemt to login..." + " " + username);
  
      fetch('api/SampleData/Login', {
          method: "POST",
          body: JSON.stringify({
              email: username,
              password: password,
          })
      }).then(response =&gt; response.json())
          .then(json =&gt;callback(json))
  }
  
   function Login(props) {
  
      var logged = false;
  
      var data = { username: '', password: '', };
  
  
      function getUsername(event) {
          data.username = event.target.value;
          console.log(data);
      }
  
      function getPassword(event) {
          data.password = event.target.value;
          console.log(data);
      }
  
      function requestCallback(res) {
          if (res[0] === "connected") {
  
  
              props.history.push('/');
              console.log(props.history);
          }
      }
  
      if (logged === true) {
  
          return (&lt;Redirect to="/" component={Home} /&gt;);
      }
       return (
          &lt;div style={{ position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }}&gt;
               &lt;Form &gt;
                  &lt;FormGroup controlId="formBasicEmail"&gt;
                      &lt;Label&gt;Email address&lt;/Label&gt;
                      &lt;FormControl type="email" placeholder="Enter email" onChange={getUsername} /&gt;
                  &lt;/FormGroup&gt;
                  &lt;FormGroup controlId="formBasicPassword"&gt;
                      &lt;Label&gt;Password&lt;/Label&gt;
                       &lt;FormControl type="password" placeholder="Password" onChange={getPassword} /&gt;
                  &lt;/FormGroup&gt;
  
                   &lt;Button variant="primary" onClick={() =&gt; LoginUser(data.username, data.password, requestCallback)} style={{ margin: '0 auto', display: 'block', width: '100px' }}&gt;
                      Login
                   &lt;/Button&gt;
              &lt;/Form&gt;
          &lt;/div&gt;
  
      );
  }
  
  export default withRouter(Login);
  </code></pre>
  
  <p>As you can see Login component is wrapped with withRouter(Login).  console.log(props)  in Login.js file shows that history is passed to props. </p>