I need to call SearchScreen class method from a React Navigation Header.
The Navigator look like this:
Search: {
screen: SearchScreen,
path: \'
I've resolved the issueI've resolved the issue be the following way:
static navigationOptions = ({ navigation }) => {
return {
headerRight: () => (
Sync
),
};
};
componentDidMount() {
this.props.navigation.setParams({ onPressSyncButton: this._onPressSyncButton });
}
_onPressSyncButton = () => {
console.log("function called");
}