1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Reactライフサイクル

Posted at

image.png

##Mount
 コンポーネントが配置される(生まれる)期間
##Update
 コンポーネントが変更される(成長する)期間
##Unmount
 コンポーネントが破棄(死ぬ)期間
image.png

##Mounting

constructor()

初期化(stateなど)

render()

VDOMを描画(JSXをリターン)

componentDidMount()

render()後に一度だけ呼ばれる
リスナーの設定やAPI通信に使われる 

##Update

render()

VDOMを再描画

componentDiaUpdate()

再render()後に呼ばれる
スクロールイベントや条件付イベント

##Unmount

componentWillUnmount()

コンポーネントが破棄される直前
リソースを解放するため、リスナーの解除など

1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?