0

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?

Passaro
  • 93
  • 1
  • 8

1 Answers1

0

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})
Engazan
  • 470
  • 1
  • 3
  • 16