LoginSignup
1
0

More than 5 years have passed since last update.

React NavigationのStackNavigatorでB画面からA画面に戻った時にA画面を更新する

Posted at

やりたいこと

画面Bで画面Aに関する処理をした後にgoBackで戻ると画面Aの内容は更新されない。
goBackで画面Aの内容を更新された状態で表示させたい。

やり方

  1. this.setStateするハンドルを画面Aから画面Bに遷移する時にパラーメータとして渡す。
  2. 画面Bで画面Aに関する処理をした時にそのハンドルを実行する。

参考ソース: https://github.com/react-navigation/react-navigation/issues/922#issuecomment-344752635

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0