回答編集履歴
5
テキスト修正
answer
CHANGED
@@ -129,7 +129,7 @@
|
|
129
129
|
|
130
130
|
- ja.reactjs.org: [state とライフサイクル](https://ja.reactjs.org/docs/state-and-lifecycle.html)
|
131
131
|
|
132
|
-
あたりです。上記のページで、「[クラスにライフサイクルメソッドを追加する](https://ja.reactjs.org/docs/state-and-lifecycle.html#adding-lifecycle-methods-to-a-class) 」の節の終わりに、
|
132
|
+
あたりです。上記のページで、「[クラスにライフサイクルメソッドを追加する](https://ja.reactjs.org/docs/state-and-lifecycle.html#adding-lifecycle-methods-to-a-class) 」の節の終わりに、 [Clockの完成版](https://codepen.io/gaearon/pen/amqdNA?editors=0010)について動作の流れが 1. 〜 5. として順に説明されています。その中で
|
133
133
|
|
134
134
|
> 4. ・・・ setState() が呼び出されたおかげで、React は state が変わったということが分かるので、render() メソッドを再度呼び出して、画面上に何を表示すべきかを知ります。・・・
|
135
135
|
|
4
テキスト修正
answer
CHANGED
@@ -129,11 +129,11 @@
|
|
129
129
|
|
130
130
|
- ja.reactjs.org: [state とライフサイクル](https://ja.reactjs.org/docs/state-and-lifecycle.html)
|
131
131
|
|
132
|
-
あたりです。上記のページで `<Clock />` の完成版についての説明
|
132
|
+
あたりです。上記のページで、「[クラスにライフサイクルメソッドを追加する](https://ja.reactjs.org/docs/state-and-lifecycle.html#adding-lifecycle-methods-to-a-class) 」の節の終わりに、 `<Clock />` の完成版について動作の流れが 1. 〜 5. として順に説明されています。その中で
|
133
133
|
|
134
134
|
> 4. ・・・ setState() が呼び出されたおかげで、React は state が変わったということが分かるので、render() メソッドを再度呼び出して、画面上に何を表示すべきかを知ります。・・・
|
135
135
|
|
136
|
-
|
136
|
+
と書かれており、上記の[原文](https://en.reactjs.org/docs/state-and-lifecycle.html) は、
|
137
137
|
|
138
138
|
> 4.・・・ Thanks to the setState() call, React knows the state has changed, and calls the render() method again to learn what should be on the screen. ・・・
|
139
139
|
|
3
テキスト修正
answer
CHANGED
@@ -125,7 +125,7 @@
|
|
125
125
|
|
126
126
|
### 追記
|
127
127
|
|
128
|
-
|
128
|
+
このご質問で確認しておく必要のある内容は Reactの基本ですので、[公式ドキュメント](https://ja.reactjs.org/docs/)を拠り所にすることをお勧めします。このご質問の疑問を解消するという目的ですと、 MAIN COCEPTS の章の
|
129
129
|
|
130
130
|
- ja.reactjs.org: [state とライフサイクル](https://ja.reactjs.org/docs/state-and-lifecycle.html)
|
131
131
|
|
2
テキスト修正
answer
CHANGED
@@ -125,15 +125,15 @@
|
|
125
125
|
|
126
126
|
### 追記
|
127
127
|
|
128
|
-
把握し整理しておく必要のある内容は、Reactの基本ですので、公式ドキュメントを拠り所にすることをお勧めします。このご質問の疑問を解消するという目的ですと
|
128
|
+
把握し整理しておく必要のある内容は、Reactの基本ですので、[公式ドキュメント](https://ja.reactjs.org/docs/)を拠り所にすることをお勧めします。このご質問の疑問を解消するという目的ですと、 MAIN COCEPTS の章の
|
129
129
|
|
130
130
|
- ja.reactjs.org: [state とライフサイクル](https://ja.reactjs.org/docs/state-and-lifecycle.html)
|
131
131
|
|
132
|
-
あたりです。上記のページで `<Clock />` の完成版についての説明に以下
|
132
|
+
あたりです。上記のページで `<Clock />` の完成版についての説明に以下
|
133
133
|
|
134
134
|
> 4. ・・・ setState() が呼び出されたおかげで、React は state が変わったということが分かるので、render() メソッドを再度呼び出して、画面上に何を表示すべきかを知ります。・・・
|
135
135
|
|
136
|
-
[原文](https://en.reactjs.org/docs/state-and-lifecycle.html)
|
136
|
+
のように書かれており、上記の[原文](https://en.reactjs.org/docs/state-and-lifecycle.html) では、
|
137
137
|
|
138
138
|
> 4.・・・ Thanks to the setState() call, React knows the state has changed, and calls the render() method again to learn what should be on the screen. ・・・
|
139
139
|
|
1
テキスト修正
answer
CHANGED
@@ -121,4 +121,28 @@
|
|
121
121
|
|
122
122
|
という点をしっかり押さえておき、その上で、コンポーネントの(`componentDidMount`などの)ライフサイクルメソッドの理解を点検するとよいかと思います。
|
123
123
|
|
124
|
-
以上、参考になれば幸いです。
|
124
|
+
以上、参考になれば幸いです。
|
125
|
+
|
126
|
+
### 追記
|
127
|
+
|
128
|
+
把握し整理しておく必要のある内容は、Reactの基本ですので、公式ドキュメントを拠り所にすることをお勧めします。このご質問の疑問を解消するという目的ですと
|
129
|
+
|
130
|
+
- ja.reactjs.org: [state とライフサイクル](https://ja.reactjs.org/docs/state-and-lifecycle.html)
|
131
|
+
|
132
|
+
あたりです。上記のページで `<Clock />` の完成版についての説明に以下のように書かれています。
|
133
|
+
|
134
|
+
> 4. ・・・ setState() が呼び出されたおかげで、React は state が変わったということが分かるので、render() メソッドを再度呼び出して、画面上に何を表示すべきかを知ります。・・・
|
135
|
+
|
136
|
+
[原文](https://en.reactjs.org/docs/state-and-lifecycle.html) のほうでは、
|
137
|
+
|
138
|
+
> 4.・・・ Thanks to the setState() call, React knows the state has changed, and calls the render() method again to learn what should be on the screen. ・・・
|
139
|
+
|
140
|
+
と書かれています。この中の
|
141
|
+
|
142
|
+
**Thanks to the setState() call, React knows the state has changed, and calls the render() method again**
|
143
|
+
|
144
|
+
のことを、私の回答の冒頭では
|
145
|
+
|
146
|
+
> setState によって this.state に変更があったら、自動的にrenderを呼んでくれる仕組みをReactが提供してくれている
|
147
|
+
|
148
|
+
と表現しました。
|