I have used multiple StackNavigators inside a single StackNavigator. I want to navigate to a specific screen in a stack instead of the initialRouteName defined when navigating.
I have tried the StackActions / NavigationActions with navigation.dispatch(). But could not solve the issue.
const firstStack = createStackNavigator({
firstScreen: firstScreen,
secondScreen: secondScreen
},
{initialRouteName: 'firstScreen'});
const secondStack = createStackNavigator({
thirdScreen: thirdScreen,
fourthScreen: fourthScreen
},
{initialRouteName: 'thirdScreen'});
const appStack = createStackNavigator({
firstStack: firstStack,
secondStack: secondStack
});
I want to navigate from firstStack - firstScreen to secondStack - fourthScreen.