function navigateAndReset(routeName, params) {
  navigator.dispatch(
    StackActions.reset({
      index: 0,
      key: null,
      actions: [
        NavigationActions.navigate({
          routeName,
          params,
        }),
      ],
    })
  )
}
/**
 * Call this function when you want to navigate to a specific route AND reset the navigation history.
 *
 * That means the user cannot go back. This is useful for example to redirect from a splashscreen to
 * the main screen: the user should not be able to go back to the splashscreen.
 *
 * @param routeName The name of the route to navigate to. Routes are defined in RootScreen using createStackNavigator()
 * @param params Route parameters.
 */
Call this function when you want to navigate to a specific route AND reset the navigation history.
That means the user cannot go back. This is useful for example to redirect from a splashscreen to
the main screen: the user should not be able to go back to the splashscreen.

@param routeName The name of the route to navigate to. Routes are defined in RootScreen using createStackNavigator()
@param params Route parameters.
Call this function when you want to navigate to a specific route AND reset the navigation history . That means the user cannot go back . This is useful for example to redirect from a splashscreen to the main screen : the user should not be able to go back to the splashscreen . @param routeName The name of the route to navigate to . Routes are defined in RootScreen using createStackNavigator () @param params Route parameters .
function navigateAndReset(routeName, params) {
  navigator.dispatch(
    StackActions.reset({
      index: 0,
      key: null,
      actions: [
        NavigationActions.navigate({
          routeName,
          params,
        }),
      ],
    })
  )
}
function navigateAndReset ( routeName , params ) { navigator . dispatch ( StackActions . reset ( { index : 0 , key : null , actions : [ NavigationActions . navigate ( { routeName , params , } ) , ] , } ) ) }
Call this function when you want to navigate to a specific route AND reset the navigation history.
Call this function when you want to navigate to a specific route AND reset the navigation history .