I'm setting up a Tabs with Stack navigation and I have an unexpected behavior when I try to change the components. I want to open the first component of Stack navigation when I navigate through Tabs. Please check out this video, so you understand what I mean.
I try to pass the props 'initialRouteName' but doesn't work. Here is my code:
const familyStackNavigator = createStackNavigator({
main: { screen: parentFamilyScreen },
resume: { screen: ResumeChildScreen }
},
{
mode: 'modal',
headerMode: 'none',
initialRouteName: 'main',
});
const parentAppStack = createMaterialBottomTabNavigator({
family: {
screen: familyStackNavigator,
navigationOptions: {
tabBarIcon: FirstTabIcon,
title: 'Familia'
}
},
bag: {
screen: parentBagScreen,
navigationOptions: {
tabBarIcon: SecondTabIcon,
title: 'Bolsillo'
}
},
{
initialRouteName: 'family',
activeColor: '#ED0F21',
inactiveColor: '#333333',
barStyle: { backgroundColor: 'white' },
labeled: true
})