title: React Router 4 authentification and redirection
body: <p>I'm trying to implement an authentification system to my app with React Router.
  But i'm having trouble to find a correct way to do this.</p>
  
  <pre><code>export default class App extends React.Component {
    constructor(props){
      super(props);
  
      this.state = {
        logged : false
      }
  
    }
  
    isUserConnected(){
      // Contact server to know if user is connected or not
    }
  
    render() {
      return (
          &lt;Router&gt;
            &lt;Switch&gt;
              &lt;Route exact path="/" component={Homepage} /&gt;
              &lt;Route path="/privatePart" component={Application} /&gt; 
              &lt;Route path="/login" component={LoginRedirection} /&gt;
              &lt;Route component={NotFound} /&gt;
            &lt;/Switch&gt; 
          &lt;/Router&gt;
      )
    }
  }
  </code></pre>
  
  <p><strong>In the LoginRedirection component, there is a login form that make a POST to connect the user. But how this component can set logged to true in the App component ?</strong></p>
  
  <p>Maybe I should learn redux ? It may be simplier to implement authentification with it ?</p>