Reputation: 8683
I want to set the header
to null
.
Currently, I am trying to do
const HomeStack = createStackNavigator({
Home: HomeScreen,
})
HomeStack.navigationOptions = {
tabBarLabel: 'Home',
header: null
}
But the above header: null
doesn't work.
But the below code does work.
class HomeScreen extends React.Component {
static navigationOptions = {
header: null,
}
render() {
...
}
}
How do I make it work in HomeStack.navigationOptions
?
Also, can I set a global header: null
because I don't want header
in any of my screens?
Upvotes: 1
Views: 1050
Reputation: 150
Try something like this (note headerModel: 'none'):
const MainStack = createStackNavigator(
{
Home: { screen: Home },
},
{ initialRouteName: 'Home', headerMode: 'none' }
);
Upvotes: 2