4

I'm usging Reactnative with React-Navigation 6 I created a Stack Navigator called HomeStacks and it has Home and Comment components.

And I put HomeStack in BottomTab.

At this time, I want to show BottomTab only in Home and hide BottomTab in Comment.

How can I do that?

This is my code

const HomeStack = createNativeStackNavigator();


const HomeStacks = () => {
  return (
    <HomeStack.Navigator>
      <HomeStack.Screen
        name="Home"
        component={Home}
      />
      <HomeStack.Screen
        name="Comment"
        component={Comment}
      />
    </HomeStack.Navigator>
  );
};


const BottomTab = createBottomTabNavigator();


<BottomTab.Navigator
      screenOptions={{headerShown: false, tabBarShowLabel: false}}>
      <BottomTab.Screen
        name="HomeStacks"
        component={HomeStacks}
        options={{
          <Ionicons name="home" size={28} style={{color: 'black'}} />
        }}
      />


    </BottomTab.Navigator>
user19476497
  • 495
  • 1
  • 10
  • Does this answer your question? [How to hide bottom navigation bar on a specific screen in react native?](https://stackoverflow.com/questions/56745881/how-to-hide-bottom-navigation-bar-on-a-specific-screen-in-react-native) – Abe Dec 21 '22 at 05:32
  • can you Cleary explain me ? –  Dec 23 '22 at 12:49
  • I have solution but not Sure what you want –  Dec 23 '22 at 12:51

1 Answers1

-1

Do this in your HomeStacks :

function HomeStacks({ navigation }) {
    navigation.setOptions({ tabBarVisible: false })
    return (
        <View></View>
    )
}
abdemirza
  • 629
  • 4
  • 16