In my react-native NavigatorIOS app, I am trying to use the onRightButton feature. I want to call a function from the component I am pushing, but I can't figure out how to do it. Here's an example of my code:
this.props.navigator.push({
component: SingleResultView,
title: "SomeTitle",
rightButtonIcon: require('image!mapsmarker'),
passProps: {
userPosition: this.props.userPosition
},
onRightButtonPress: () => { SingleResultView.foo(); } // NOT WORKING!
});
Any ideas on how to make this work?