React-native-router-flux: How to access right navbar button inside component

Created on 6 Feb 2017  路  1Comment  路  Source: aksonov/react-native-router-flux

I have a component with few data that must be post to the server.I don't know this is the right way or not , but I need since the user press the post button in navbar , post function will be run inside component.

Most helpful comment

I don't know if this is the best way to do it, but it works:

Inside of the component in which you want to have right navbar button put this code

componentWillMount() {
    Actions.refresh({ onRight: this.search, rightTitle: 'Search' });
}

>All comments

I don't know if this is the best way to do it, but it works:

Inside of the component in which you want to have right navbar button put this code

componentWillMount() {
    Actions.refresh({ onRight: this.search, rightTitle: 'Search' });
}
Was this page helpful?
0 / 5 - 0 ratings