Skip to content

Navigate to a stack in createSwitchNavigator using NavigationActions #4669

@srajchevski

Description

@srajchevski

Given the switchNavigator below (taken from the official example), how can one navigate to the AuthStack, from outside a component, which means without this.props.navigation ?

export default createSwitchNavigator(
  {
      AuthLoading: AuthLoadingScreen,
      App: AppStack,
      Auth: AuthStack,
   },
   {
      initialRouteName: 'AuthLoading',
   }
);

I already tried NavigationActions.navigate({ routeName: 'Auth' }); , but with no luck.

Version:
"react-navigation": "~2.3.1",

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions