React Life-Cycle

There are three main phases of the react life-cycle, which are the mounting phase, the updating phase and the unmounting phase.

The mounting phase is when a component is first created and inserted into DOM (Document Object Model). In this phase, several life-cycle methods are invoked by React to enable the configuration of components etc and it has three main life-cycle methods called - constructor() life-cycle, render life-cycle method and the Did mount.

The updating phase occurs when props or state changes and there needs to be an update of components in the DOM. It also has other methods inside it called WillUpdate() life-cycle method and two others.

The unmounting phase is the stage where a component is removed from the DOM and is no longer rendered or accessible and this is the last phase in the React life-cycle