title: Backhandler quits app instead of going back to relative screen
body: <p>Using nested stacks when I go back to my homescreen, my homescreen briefly shows, then the app quits. Instead of hardcoding the route to go back to, how can I go back to my homescreen without quitting the app?</p>
  
  <pre><code>  componentWillUnmount() {
      BackHandler.removeEventListener("hardwareBackPress", this.onBackPress);
    }
  
    componentDidMount() {
      BackHandler.addEventListener("hardwareBackPress", this.onBackPress);
    }
  
    onBackPress = () =&gt; {
      const { dispatch } = this.props;
  
      const resetAction = StackActions.reset({
        index: 0,
        actions: [NavigationActions.navigate({ routeName: "Home" })]
      });
      this.props.navigation.dispatch(resetAction);
    };
  </code></pre>
  
  <p>App navigator:</p>
  
  <pre><code>const withHeader = (
      screen: Function,
      routeName: string,
      Header
  ): StackNavigator =&gt;
      createStackNavigator(
          {
              [routeName]: {
                  screen,
                  navigationOptions: ({ routeName, props }) =&gt; ({
                      header: props =&gt; &lt;Header {...props} /&gt;
                  })
              }
          },
          {
              initialRoute: "Home",
              transparentCard: true,
              cardStyle: {
                  backgroundColor: "transparent",
                  opacity: 1
              },
              transitionConfig: () =&gt; ({
                  containerStyle: {
                      backgroundColor: "transparent"
                  }
              })
          }
      );
  
  const routes = {
      VideoEpisodes: {
          screen: withHeader(VideoEpisodesScreen, "Video Episodes", DrawerHeader)
      },
      TestYourself: {
          screen: withHeader(TestYourselfScreen, "Test Yourself", DrawerHeader)
      },
      MyResults: {
          screen: withHeader(MyResultsScreen, "My Results", DrawerHeader)
      },
      BookmarkedVideos: {
          screen: withHeader(
              BookmarkedVideosScreen,
              "Bookmarked Videos",
              DrawerHeader
          )
      },
      About: {
          screen: withHeader(AboutScreen, "About", DrawerHeader)
      }
  };
  
  const NestedDrawer = createDrawerNavigator(routes, config);
  
  const MainStack = createStackNavigator(
      {
          Home: {
              screen: HomeScreen,
              navigationOptions: ({ props }) =&gt; ({
                  header: props =&gt; &lt;BasicHeader {...props} /&gt;
              })
          },
          Drawer: {
              screen: NestedDrawer,
              navigationOptions: ({ props }) =&gt; ({
                  header: () =&gt; null
              })
          },
          VideoPlayer: {
              screen: VideoPlayerScreen,
              navigationOptions: ({ props }) =&gt; ({
                  header: props =&gt; &lt;BasicHeader {...props} /&gt;
              })
          }
      },
      {
          initialRoute: "Home",
          transparentCard: true,
          cardStyle: {
              backgroundColor: "transparent",
              opacity: 1
          },
          transitionConfig: () =&gt; ({
              containerStyle: {
                  backgroundColor: "transparent"
              }
          })
      }
  );
  </code></pre>