title: URL change after sign in and don't show view(no reload, render page) - react
body: <p>I have a login react class that after passed authentication and successfully authenticated to page should take me to admin page but in this situation it just change URL to admin page after successful sign in or sign out but doesn't show any new admin component at all. I am using react-router v4 and this app don't work with it quite well. Here is My components
  Maybe there is any way to solve this problem. I used high order component withRouter that should solve this problem but it doesn't do anything. I have no errors in console.</p>
  
  <pre><code>Sign In
  
  import React, {Component} from 'react';
  import {connect} from 'react-redux';
  import {reduxForm, Field} from 'redux-form';
  import {withRouter} from 'react-router-dom';
  import * as actions from '../../actions/signin_user';
  
  
  class SignIn extends Component {
      handleFormSubmit({email, password}) {
          this.props.signinUser({email, password});    
      }
  
      renderAlert() {
          if (this.props.errorMessage) {
              return (
                  &lt;div className="alert alert-danger"&gt;
                      &lt;strong&gt;Oops! Błąd logowania, kod błędu: {this.props.errorMessage}&lt;/strong&gt;
                  &lt;/div&gt;
              )
          }
      }
  
  
      render() {
          const {handleSubmit, fields: {email, password}} = this.props;
          return (
              &lt;form onSubmit={handleSubmit(this.handleFormSubmit.bind(this))}&gt;
                  &lt;fieldset className="form-group"&gt;
                      &lt;label&gt;Adres Email:&lt;/label&gt;
                      &lt;Field {...email} name="email" type="text" className="form-control" component="input"/&gt;
                  &lt;/fieldset&gt;
                  &lt;fieldset className="form-group"&gt;
                      &lt;label&gt;Hasło:&lt;/label&gt;
                      &lt;Field {...password} name="password" type="password" className="form-control" component="input"/&gt;
                  &lt;/fieldset&gt;
                  {this.renderAlert()}
                  &lt;button action="submit" className="btn btn-primary"&gt;Zaloguj się&lt;/button&gt;
              &lt;/form&gt;
          )
      }
  }
  
  function mapStateToProps(state) {
      return {errorMessage: state.auth.error}
  }
  
  SignIn = reduxForm({form: 'SignIn', fields: ['email', 'password']})(SignIn);
  
  export default withRouter(connect(mapStateToProps, actions)(SignIn));
  </code></pre>
  
  <p>Admin Page</p>
  
  <pre><code>/**
   * Created by konraduciechowski on 26.08.2017.
   */
  import React, {Component} from 'react';
  
  import {Link} from 'react-router-dom';
  
  
  class AdminPage extends Component {
      render() {
  
          return (
              &lt;div className="header-stick"&gt;
                  {/*IMPORTANT ADD FUNCTION TO NOT ABLE EVERYONE TO GET TO ADMIN PAGE
                   WHEN THEIR NOT ADMIN*/}
                  {/*NEED TO FIX ROUTES FOR ADMIN PAGE*/}
                  &lt;ul className="admin-menu"&gt;
                      &lt;li className="admin-menu-item"&gt;
                          &lt;Link to="/panel+administracyjny/kalendarz"&gt;Kalendarz&lt;/Link&gt;
                      &lt;/li&gt;
                      &lt;li className="admin-menu-item"&gt;
                          &lt;Link to="/panel+administracyjny/blog"&gt;Blog&lt;/Link&gt;
                      &lt;/li&gt;
                      &lt;li className="admin-menu-item"&gt;
                          &lt;Link to="/panel+administracyjny/pracownik"&gt;Zarządzanie pracownikami&lt;/Link&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
  
              &lt;/div&gt;
          )
      }
  }
  
  export default AdminPage;
  </code></pre>
  
  <p>redux action</p>
  
  <pre><code>/**
   * Created by konraduciechowski on 16.10.2017.
   */
  import axios from 'axios';
  import history from '../helpers/history';
  import {AUTH_USER, AUTH_ERROR, UNAUTH_USER} from './types'
  
  const ROOT_DEV_API = 'http://salonenface.dev/api/';
  const ROOT_PROD_API = 'https://salonenface.pl/api/';
  const ROOT_TEST_API = 'http://localhost:3090';
  
  
  export function signinUser({email, password}) {
      return function (dispatch) {
  
  //Submit password n' email to server
          axios.post(`${ROOT_TEST_API}/signin`, {email, password})
              .then(response =&gt; {
                  //    if request is good...
  
                  //    Update state to indicate user is authenticated
                  dispatch({type: AUTH_USER});
                  //    Save JWT token
                  localStorage.setItem('token', response.data.token);
                  //    redirect to admin route section
                  history.push("/panel+administracyjny");
              })
              .catch((error) =&gt; {
                  ///////////////////////////////////////////
                  //    if request is bad...
  
                  //  show error to user
                  dispatch(authError(error.response.status));
              })
      }
  
  }
  
  export function signupUser({email, password}) {
      return function (dispatch) {
          axios.post(`${ROOT_TEST_API}/signup`, {email, password})
              .then(response =&gt; {
                  dispatch({type: AUTH_USER});
                  localStorage.setItem('token', response.data.token);
                  history.push('/panel+administracyjny');
              })
              .catch(error =&gt; dispatch(authError(error.response.data.error)))
      }
  }
  
  export function authError(error) {
      return {
          type: AUTH_ERROR,
          payload: error
      }
  }
  
  export function signoutUser() {
      localStorage.removeItem('token');
      return {type: UNAUTH_USER}
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Router.js</p>
  
  <pre><code>//React imports
  import React, {Component} from 'react';
  import {
      BrowserRouter as Router,
      Route,
      Switch,
      Redirect,
      withRouter
  } from 'react-router-dom';
  
  //Redux imports
  import {Provider} from 'react-redux';
  import {createStore, applyMiddleware} from 'redux';
  import promise from 'redux-promise';
  import reduxThunk from 'redux-thunk';
  
  //Css imports
  import '../styles/App.css';
  import '../styles/Admin.css';
  import '../../node_modules/bootstrap/dist/css/bootstrap.css';
  import '../../node_modules/font-awesome/css/font-awesome.css';
  import '../../node_modules/react-big-calendar/lib/css/react-big-calendar.css';
  
  //Page Components imports
  import Header from './SiteElementsComponents/Header';
  import About from './MainComponents/About';
  import Blog from './MainComponents/Blog';
  import BlogPost from './MainComponents/BlogPost';
  import Contact from './MainComponents/Contact';
  import Home from './MainComponents/Home';
  import Order from './CalendarComponents/Order';
  import Services from './MainComponents/Services';
  import Login from './AuthComponents/Login';
  import Register from './AuthComponents/Register';
  import Footer from './SiteElementsComponents/Footer';
  import OrderComplete from './CalendarComponents/OrderComplete';
  import SignIn from './AuthComponents/SignIn';
  import SignOut from './AuthComponents/SignOut';
  import SignUp from './AuthComponents/SignUp';
  
  //Admin Components imports
  import AdminPage from './AuthComponents/AdminComponents/AdminPage';
  import AdminCalendar from './AuthComponents/AdminComponents/AdminCalendar';
  import AdminBlog from './AuthComponents/AdminComponents/AdminBlog';
  import AdminBlogNewPost from './AuthComponents/AdminComponents/AdminBlogNewPost';
  import AdminBlogShowPost from './AuthComponents/AdminComponents/AdminBlogShowPost';
  import AdminEmployee from './AuthComponents/AdminComponents/AdminEmployee';
  import AuthExample from './TestComponents/AuthExample';
  
  //Redux reducers
  import reducers from '../reducers';
  
  //History
  import history from '../helpers/history';
  
  //Middleware
  const createStoreWithMiddleware = applyMiddleware(promise, reduxThunk)(createStore);
  
  const App = () =&gt; {
  
          return (
              &lt;Provider store={createStoreWithMiddleware(reducers)}&gt;
                  &lt;div&gt;
                      &lt;div className="col-xs-12"&gt;
                          &lt;Router history={history}&gt;
                              &lt;div&gt;
                                  &lt;Header/&gt;
                                  &lt;div className="container background-block"&gt;
                                      &lt;Switch&gt;
                                          &lt;Route exact path="/" component={Home}/&gt;
                                          &lt;Route path="/o+nas" component={About}/&gt;
                                          &lt;Route path="/aktualnosci" component={Blog}/&gt;
                                          &lt;Route path="/post/:id" component={BlogPost}/&gt;
                                          &lt;Route path="/kontakt" component={Contact}/&gt;
                                          &lt;Route path="/uslugi" component={Services}/&gt;
                                          &lt;Route path="/logowanie" component={Login}/&gt;
                                          &lt;Route path="/signin" component={SignIn}/&gt;
                                          &lt;Route path="/wylogowanie" component={SignOut}/&gt;
                                          &lt;Route path="/signup" component={SignUp}/&gt;
                                          &lt;Route path="/rejestracja" component={Register}/&gt;
                                          &lt;Route path="/wizyta+zapisana" component={OrderComplete}/&gt;
                                          {/*Calendar options*/}
                                          &lt;Route path="/wizyta+zapisana" component={OrderComplete}/&gt;
                                          &lt;Route path="/wizyta" component={Order}/&gt;
                                      &lt;/Switch&gt;
                                      {/*test options*/}
                                      &lt;Route exact path="/AuthExample" component={AuthExample}/&gt;
                                      {/*/!*admin options*!/*/}
                                      &lt;Switch&gt;
                                          &lt;Route exact path="/panel+administracyjny" component={AdminPage}/&gt;
                                          &lt;Route path="/panel+administracyjny/kalendarz" component={AdminCalendar}/&gt;
                                          {/*admin blog options*/}
                                          &lt;Route path="/panel+administracyjny/blog" component={AdminBlog}/&gt;
                                          &lt;Route path="/panel+administracyjny/post/nowy" component={AdminBlogNewPost}/&gt;
                                          &lt;Route path="/panel+administracyjny/pokaz+post/:id"
                                                 component={AdminBlogShowPost}/&gt;
                                          {/*admin employee options*/}
                                          &lt;Route path="/panel+administracyjny/pracownik" component={AdminEmployee}/&gt;
                                      &lt;/Switch&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/Router&gt;
                          &lt;Footer/&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/Provider&gt;
          );
  
  }
  
  export default App;
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import App from './components/Router';
  import registerServiceWorker from './registerServiceWorker';
  import './styles/index.css';
  
  ReactDOM.render(&lt;App /&gt;, document.getElementById('app'));
  registerServiceWorker();
  </code></pre>