React Native: tabBarVisible option set to false but not hidding the the tabBar

I’m using React Navigation v5 but the when i set the option tabBarVisible to false the tabBar is not hidding. Here is a piece of code that is not working. I don’t know what’s wrong.

..

  <Tabs.Navigator screenOptions={screenOptions} initialRouteName="Home">
      <Tabs.Screen
        name="Home"
        component={Home}
        options={({ route }) => ({
          tabBarVisible: false, // <-- This not working
          tabBarIcon: (props) => (
            <TabIcon
              {...props}
              title="Home"
              Icon={{
                name: "home",
                IconComponent: AntDesign,
              }}
            />
          ),
        })}
      />
...

Any suggessions.

Answer

This should work with the latest version of the package:

  <Tab.Screen
    name="Settings"
    component={SettingsScreen}
    options={{ tabBarStyle: { display: 'none' } }}
  />