1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

再レンダリングについて理解する

Posted at

Stateが更新されたときに関数コンポーネントは再び先頭から処理が実行され、またStateが更新されたらまた先頭からと差分があるDOMを検知して、その変更を反映して画面に表示する仕組みとなっています。

変更を検知してComponentを再処理することを再レンダリングという。

初回のレンダリング(Componentのマウント)時と再レンダリングは異なり、useStateの()で設定している初期値はマウント時だけで、毎回初期化されることはない。

再レンダリングが起きる条件

再レンダリングが起きるのは、以下の3つ。

  1. Stateが更新されたComponent
  2. Propsが変更されたComponent
  3. 再レンダリングされたComponent配下の全Component
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?