Reactネイティブアクションは、ページリターンとコールバックデータの2つのメソッドを実装します。

方法1:

ページが戻るときのパラメーター

Actions.popTo( 'login'); 
setTimeout(()=> { 
   Actions.refresh({phone:this.state.phoneTextValue、pwd:this.state.passwordValue})
})

前のページのパラメーターを受け入れます。

componentWillReceiveProps(nextProps):void { 
    // console.log( 'componentWillReceiveProps')
   this.setState({phoneTextValue:nextProps.phone、passwordValue:nextProps.pwd})
}

 

方法2:

セルバックパラメータの更新を含む設定ページに移動します。

Actions.setting({refresh:()=> {this.getUserInfo()}、})}

2ページ目が戻る直前:通行人のセルバックパラメータrefresh()を呼び出します。getUserInfoに関連するビジネスコードを実装する

Actions.pop(this.props.refresh());

おすすめ

転載: blog.csdn.net/qq_36355271/article/details/105520900