前回投稿にとりあえずログをいれる。
storeが更新された場合
ストア更新(profile/updateUid)
↓
Aスクリーン
↓
Bスクリーン
↓
ストア更新(profile/updateUid)
↓
Aスクリーン
setStateした場合
❯ git diff
diff --git a/app/containers/Bscreen.js b/app/containers/Bscreen.js
index 477e965..c844821 100644
--- a/app/containers/Bscreen.js
+++ b/app/containers/Bscreen.js
@@ -50,7 +50,7 @@ class BScreen extends Component {
<Text>{this.state.userName}</Text>
<Button
onPress={() => {
- this.props.updateUid('JIRO');
+ this.setState({ userName: 'JIRO' });
}}
title="UPDATE name"
/>
もちろん、getDerivedStateFromPropsが呼ばれないだけ。
ストア更新(profile/updateUid)
↓
Aスクリーン
↓
Bスクリーン
↓
setState
↓
Aスクリーン