Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

Changing initialRouteName dynamically when navigating between StackNavigators (Nested Stack)

$
0
0

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.


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>