lifecycle

[1/1]

  1. React: useState、useReducer、getDerivedStateFromProps、componentWillReceiveProps の使い分け
    概要React のライフサイクルメソッド componentWillReceiveProps と getDerivedStateFromProps は、コンポーネントのプロパティが変更されたときに実行されるメソッドです。しかし、それぞれの役割と使い方は異なります。