I have a Stack Navigator with some screens and an initial route like "Profile", and when I navigate to "Options" via a navigation.navigate("Options")
from the "Profile" screen, I don't want to see the bottom tabs. Here's an example of what I have:
ProfileNav.js
export default function ProfileNav () {
return (
<Stack.Navigator initialRoutName="Profile">
<Stack.Screen name="Profile" component={ProfileScreen}>
<Stack.Screen name="Options" component={OptionsScreen}>
</Stack.Navigator>
);
};
TabNav.js
export default function TabNav () {
return (
<Tab.Navigator initialRouteName="Home">
<Tab.Screen name="Home" component={HomeScreen}>
<Tab.Screen name="ProfileNav" component={ProfileNav}>
</Tab.Navigator>
);
};
I'm using React Navigation v6. I've seen the Hiding tab bar in specific screens docs describe how to swap around screens to achieve hiding the tabs from a single screen, but in this case I'm trying to have the parent screen of the ProfileNav
stack still show the bottom tabs, but I don't want the rest of the screens in the stack to show them, which is not what the docs help in achieving unless I missed something.
So how do I achieve hiding the bottom tabs from select screens of a stack navigator nested in a tab navigator?
I have also tried passing in tabBarVisible
into the "Options" screen options, but this didn't work.