My app has 5 components (screens), I am using stack navigation version 5, I need the headers for all screens except one screen, I tried to do this via option inside screens like this:
This is my code:
const Stack = createStackNavigator();
const MainStack = () => ({
return(
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="MyTabs" component={MyTabs} />
<Stack.Screen name="Direct" component={Direct} />
<Stack.Screen name="Like" component={Like} />
<Stack.Screen name="Search" component={Search} />
<Stack.Screen name="Home" component={Home} />
</Stack.Navigator>
</NavigationContainer>
)
)}
use options={{ headerShown: false }}
options={{ headerShown: false }}
navigation.setOptions({ headerShown: false })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With