I currently have this navigation schema:
BottomTabNavigator
export const HomePageBottomNavigator = createBottomTabNavigator(
{
CardListStack: {
screen: CardListStack,
navigationOptions: () => ({
title: 'My Cards'
})
},
ClassListStack: {
screen: ClassListStack,
navigationOptions: () => ({
title: 'My classes'
})
}
})
CardListStack
export const CardListStack = createStackNavigator(
{
CardListPage: {
screen: CardListPage
},
CardPage: {
screen: CardPage,
headerMode: 'none'
}
},
{
headerMode: 'none',
navigationOptions: {
headerVisible: false
},
initialRouteName: 'CardListPage'
});
ClassListStack
export const ClassListStack = createStackNavigator(
{
ClassesListPage: {
screen: ClassesListPage
},
ClassPage: {
screen: ClassPage,
headerMode: 'none'
},
CardPage: {
screen: CardPage,
headerMode: 'none'
}
},
{
headerMode: 'none',
navigationOptions: {
headerVisible: false
},
initialRouteName: 'ClassesListPage',
});
So basically I have two tabs: The first one is all about cards, you can see your cards list and click to see the details of a specific card. In the second one you can find your classes, see one class in particular and click to see the cards it has.
The problem I'm facing is that when I'm in the CardListStack and I execute the following actions: Open a card, go to the ClassListStack, then go back to the CardListStack... The card is still open. The same thing happens when I open a class details, change the stack and then go back. Is there any way I can "reset" the stack when I move back to it?