How to navigate between different nested stacks in react navigation

后端 未结 14 791
情话喂你
情话喂你 2020-12-02 16:52

The Goal

Using react navigation, navigate from a screen in a navigator to a screen in a different navigator.

More Detail

If I have the following

14条回答
  •  时光取名叫无心
    2020-12-02 17:17

    You can use the third parameter of navigate to specify sub actions.

    For example, if you want to go from screen D under nested navigator 2, to screen A under nested navigator 1:

    this.props.navigation.navigate(
        'NestedNavigator1', 
        {}, 
        NavigationActions.navigate({ 
            routeName: 'screenB' 
        })
    )
    

    Check also: https://reactnavigation.org/docs/nesting-navigators/

提交回复
热议问题