react navigation传值给上一页面
使用新的导航组件react navigation,传值方式略微发生了一些改变
A页面到B页面
pushaddremark(){ let _this=this; this.props.navigation.navigate("addRemarks", { info:this.state.strdate+this.state.day+"日", getparams(textvalue){ _this.fetchStories(textvalue); } }); }
B页面代码
constructor(props) { super(props); this.state = { params:this.props.navigation.state.params, todaytime:"this.props.todaytime", textvalue:"" }; } presssave(){ this.state.params.getparams(this.state.textvalue); this.props.navigation.goBack(); }