title: How to avoid redirecting twice (react-router-redux)?
body: <p>I am using <a href="https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux" rel="nofollow noreferrer">the next (5.0.0) version react-router-redux</a> which is compatible with react-router 4.x.</p>
  
  <p>My app has two pages <code>/login</code> and <code>/home</code>.</p>
  
  <p>I am trying to redirect pages to <code>/login</code> if user visits a page not existing. This is my code</p>
  
  <pre><code>import { Route, Redirect } from 'react-router-dom';
  import { ConnectedRouter, routerMiddleware, push } from 'react-router-redux';
  
  ReactDOM.render(
    &lt;Provider store={store}&gt;
      &lt;ConnectedRouter history={history}&gt;
        &lt;div&gt;
          &lt;Route path="/login" render={() =&gt; (
            isSignedIn ? &lt;Redirect to="/home" /&gt; : &lt;Login /&gt;
          )}/&gt;
  
          &lt;Route path="/home" component={Home} /&gt;
  
          &lt;Redirect to="/login" /&gt;
        &lt;/div&gt;
      &lt;/ConnectedRouter&gt;
    &lt;/Provider&gt;,
    document.getElementById('root')
  );
  </code></pre>
  
  <p>If I remove <code>&lt;Redirect to="/login" /&gt;</code> and if the user already signed in, when he opens the page <code>/home</code>, the app will go to home page directly, which is good.</p>
  
  <p>However, with <code>&lt;Redirect to="/login" /&gt;</code>, when the user opens the page <code>/home</code>, the app will first redirect to <code>/login</code>, then goes back to <code>/home</code>.</p>
  
  <p>How can I avoid this redirecting twice? Thanks</p>