Reputation: 143
Inside of my component render()
method, I'm doing the following:
if (this.state.text) {
this.props.navigation.setOptions({
headerLeft: this.headerLeft,
});
} else {
this.props.navigation.setOptions({
headerLeft: this.headerDEFAULT,
});
}
I would like to leave headerLeft
as empty instead of this.headerDEFAULT
, to go back to its default state. How can that be done?
Upvotes: 0
Views: 386
Reputation: 525
it looks like this is inside of screen then use navigation.setOptions
headerLeft prop is your custom component so you override it
const navigation = useNavigation()
navigation.setOptions({headerLeft: (...props) => null})
Upvotes: 0