How to access component state inside navigation options in react native?

You'd need to call this.props.navigation.setParams whenever the state changes to update the params value in navigationOptions:

componentDidMount() {
  this.props.navigation.setParams({
    searchWorkouts: this.searchWorkoutHandler,
    searchText: this.state.searchText,
  });
}

onChangeSearch = (value) => {
  this.setState({
    searchText: value,
  });
  this.props.navigation.setParams({
    searchText: value,
  });
};

Tags:

React Native