if your screen is also nested stack navigation and the parent is a bottom navigation, there is a navigation prop on options function you can use. e.g.:
const BottomTab = createBottomTabNavigator();
const Home = () => (
<BottomTab.Navigator
initialRouteName="Explore"
tabBarOptions={{
activeTintColor: "#00B0F0",
}}
>
<BottomTab.Screen
name="Explore"
component={Explore}
options={({ navigation }) => {
const { routes, index } = navigation.dangerouslyGetState();
const { state: exploreState } = routes[index];
let tabBarVisible = true;
if (exploreState) {
const { routes: exploreRoutes, index: exploreIndex } = exploreState;
const exploreActiveRoute = exploreRoutes[exploreIndex];
if (exploreActiveRoute.name === "RewardDetail") tabBarVisible = false;
}
return {
tabBarVisible,
title: "Explore",
tabBarLabel: "Explore",
tabBarIcon: ({ color, size }) => (
<AntDesign name="search1" color={color} size={size} />
),
};
}}
/>
note that you will have to use if conditions there as props are not present when not activated, just simply do as my example. There is also a suggestion from the documentation: https://reactnavigation.org/docs/hiding-tabbar-in-screens/ personally i would do that if there's no option for tabBarVisible usage.