I have the following code:
_renderMenuItem(name) {
return (
<TouchableHighlight onPress={() => this._onItemClicked(name) }>
<Text>{name}</Text>
</TouchableHighlight>
)
}
_onItemClicked(name) {
Actions.categoryScreen()
this.props.dispatch(updateActivePage(name))
// Close the NavigationDrawer
Actions.refresh({ key: 'drawer', open: false })
}
The Actions.refresh()
works fine but the Actions.categoryScreen()
doesn't -looks like nothing really happens. If I replace the parameter passed to the onPress
with onPress={Actions.categoryScreen}
then it works fine and the categoryScreen is shown. However, this does not help me cause there are more stuff I want to do when onPress is triggered and I also need to pass the 'name' parameter.
Any ideas, anyone?
Thanks in advance.