Closed msageryd closed 8 years ago
I'm trying to make a save-button to use as rightButton in the navigationBar. It only need to do two things:
On other places where I need to pop the current route I'm doing:
const parentNavigator = this.props.navigator.getParentNavigator(); parentNavigator.pop();
But when I try to do this from within my component I get "Navigator does not exist". This is because navigatorUID is undefined. What have I done wrong?
@withNavigation class _CommitEditProjectButton extends React.Component { render() { if(!this.props.isEditing) return null; return ( <View style={styles.buttonContainer}> <TouchableOpacity onPress={this.commitEditProject} hitSlop={{top: 15, bottom: 15, left: 30, right: 10}}> <Text style={styles.text}>Spara</Text> </TouchableOpacity> </View> ); } commitEditProject = () => { this.props.dispatch(ProjectState.projectEditCommitAction()); const parentNavigator = this.props.navigator.getParentNavigator(); parentNavigator.pop(); } } export const CommitEditProjectButton = connect( state => ({ isEditing: ProjectSelectors.selectIsEditingProject(state) }) )(_CommitEditProjectButton)
Closing this because...
I'm trying to make a save-button to use as rightButton in the navigationBar. It only need to do two things:
On other places where I need to pop the current route I'm doing:
But when I try to do this from within my component I get "Navigator does not exist". This is because navigatorUID is undefined. What have I done wrong?