React JS - Life Cycle Methods

Each component in React has a life cycle which we can monitor and manipulate during its three main phases :

  1. Mounting - when component is loaded
  2. Updating - when component is updated
  3. Unmounting - when component is removed


To understand above React life cycle, we need to understand human life cycle. Human has three main phases :



  1. Birth
  2. Growth
  3. Death
Each phase has different methods like child(), toddler(), teenager(), adult(), old().

Similarly, each React Life Cycle phase have different methods like : constructor(), render(), componentDidMount(), etc. 

The above life cycle methods works in Class Components only. To use Life cycle in Functional Component, we use Hooks.



Comments