title: Redirect user after login with react-navigation and redux
body: <p>I have a login component in React Native.</p>
  
  <p>I use use <code>react-navigation</code> and <code>redux</code> to store <code>isLoggedIn</code> in my <code>authReducer</code>.</p>
  
  <p>I want the user to be sent away from the login component if he/she is logged in. So it should never be possible to see the login page if you are already logged in.</p>
  
  <p>I guess I have to setup the <code>navReducer</code> as they do at <a href="https://github.com/react-community/react-navigation/blob/master/examples/ReduxExample/src/reducers/index.js" rel="nofollow noreferrer">https://github.com/react-community/react-navigation/blob/master/examples/ReduxExample/src/reducers/index.js</a>. I am just not sure what is meant by</p>
  
  <pre><code>// Start with two routes: The Main screen, with the Login screen on top.
  const firstAction = AppNavigator.router.getActionForPathAndParams('Main');
  const tempNavState = AppNavigator.router.getStateForAction(firstAction);
  const secondAction = AppNavigator.router.getActionForPathAndParams('Login');
  const initialNavState = AppNavigator.router.getStateForAction(
    secondAction,
    tempNavState
  );
  </code></pre>
  
  <p>How would you normally protect some routes and force the user to log in and after he/she is successfully logged in, he/she should be sent to another route?</p>