title: Reset navigation history to Login screen using react navigation
body: <p>I would like after Login (Welcome) the user to navigate to Home. I reset the history so the user cannot go back like this:</p>
  
  <pre><code>const actionToDispatch = NavigationActions.reset({
              index: 0,
              actions: [NavigationActions.navigate({ routeName: 'Home' })]
          });
  
          this.props.navigation.dispatch(actionToDispatch);
  </code></pre>
  
  <p>This works properly. After pressing Log Out the user should go back to Welcome but <strong>it's not working</strong>. Here's what exactly I am doing:</p>
  
  <pre><code>const resetAction = NavigationActions.reset({
              index: 0,
              actions: [
                  NavigationActions.navigate({ routeName: 'Welcome' }),
              ]
          });
  
          this.props.navigation.dispatch(resetAction);
  </code></pre>
  
  <p>The error says that there is no route for 'Welcome'. Must be one of 'Main', 'Privacy', 'Terms' which are routes of one of the tabs in the Home. See them below:</p>
  
  <pre><code> const AppStack = StackNavigator({
                      Welcome: {
                          screen: Welcome
                      },
                      Home: {
                          screen: Tabs
                      }
                  }, {
                          initialRouteName: this.state.isLoggedIn ? 'Home' : 'Welcome',
                          headerMode: 'none'
                      }
                  );
  
  export const ProfileStack = StackNavigator({
      Profile: {
          screen: Profile,
      },
  });
  
  export const SettingsStack = StackNavigator({
      Settings: {
          screen: Settings,
      },
  }, {
      });
  
  export const InfoStack = StackNavigator({
      Main: {
          screen: Main,
      },
      Privacy: {
          screen: Privacy
      },
      Terms: {
          screen: Terms
      }
  });
  
  const routeConfiguration = {
  
      Profile: { screen: ProfileStack },
      Settings: { screen: SettingsStack },
      Info: { screen: InfoStack }
  };
  
  const tabBarConfiguration = {
      tabBarOptions: {
          activeTintColor: 'white',
          inactiveTintColor: 'lightgray',
          labelStyle: {
              fontSize: Normalize(10),
              fontFamily: Fonts.book
          },
          style: {
              backgroundColor: Colors.greenLightGradient,
              borderTopWidth: 1,
              borderTopColor: Colors.tabGreenLine
          },
      }
  };
  
  export const Tabs = TabNavigator(routeConfiguration, tabBarConfiguration);
  </code></pre>