Life Cycle in React JS

In React Everything has a lifecycle that can be observed or controlled during three phases

  1. Mounting

  2. Updating

  3. Unmounting

Mounting

  1. constructor

  2. getDerivedStateFromStaticProps

  3. render

  4. componentDidMount

Updating

  1. shouldComponentUpdate

  2. componentDidUpdate

  3. getSnapShotBeforeUpdate

  4. render

Unmount

  1. componentWillUnmount

Apart from this, we have

  1. componentDidCatch(To Catch Error)