0

how do I remove the header on createMaterialTopTabNavigator()? I've looked everywhere, including the documentation. So far I've only seen examples which are relevant to the previous version.

Here's my code:

<NavigationContainer headerMode='none'>
<Tab.Navigator options={{ headerShown: false }}>
<Tab.Screen name="Home" component={Home}/>
<Tab.Screen name="Settings" component={Settings}/>
</Tab.Navigator>
</NavigationContainer>
James Baloyi
  • 82
  • 12
  • Does this answer your question? [Hide header in stack navigator React navigation](https://stackoverflow.com/questions/44701245/hide-header-in-stack-navigator-react-navigation) – Muhammad Iqbal Aug 10 '20 at 08:27
  • @MuhammadIqbal unfortunately not... those seem to apply only to Stack, my issue is with Tab – James Baloyi Aug 10 '20 at 08:38

1 Answers1

0

EDITED

HeaderShown option is for screens, not navigator. So replace by this

const IndexStack = createStackNavigator()

const index = () => {
    return(
        <IndexStack.Navigator initialRouteName="tabNav">
            <IndexStack.Screen name="tabNav" options={{ headerShown: false }}  component={tabNav} />
        </IndexStack.Navigator>
    )
}

const tabNav = () => {
    return(
        <NavigationContainer>
            <Tab.Navigator>
                <Tab.Screen name="Home" component={Home} />
                <Tab.Screen name="Settings" component={Settings} />
            </Tab.Navigator>
        </NavigationContainer>
    )
}
BloodyMonkey
  • 1,572
  • 1
  • 9
  • 15