I have the following stack navigation and screens:
export const HomeStack = createStackNavigator({
Home: HomeScreen,
Categories: CategoriesScreen,
Products: ProductsScreen,
ProductDetails: ProductDetailsScreen,
})
I want to hide tabs only in ProductDetailsScreen:
export const hideTabBarComponents = [
'ProductDetails',
]
export const MainTabs = createBottomTabNavigator(
{
Home: HomeStack,
Favorite: FavoriteScreen,
Account: AccountScreen,
Help: HelpScreen,
Events: EventsScreen
},
{
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
...
},
tabBarLabel: ({ focused, tintColor }) => {
...
},
tabBarVisible: ! hideTabBarComponents.includes(navigation.state.routeName)
}),
}
);
The problem is that can't pass any options to Tab navigation from Stack Navigation
Not all of the stack screens only one of them