1.正向传值以及配置callback
this.props.navigation.navigate('ChoosePersonActivity', {
data: '1', choosed: nowFuZePerson, callback: (backdata) => {
Alert.alert(backdata);
}
});
2.第二个页面收到数据并返回数据
this.props.navigation.state.params.data
this.props.navigation.state.params.choosed
返回的方法:调用如下
this.props.navigation.state.params.callback('返回的数据');
this.props.navigation.goBack();
网友评论