DEV Community

Cover image for COMPONENT LIFECYCLE
Vinoth Kumar
Vinoth Kumar

Posted on

COMPONENT LIFECYCLE

REACT COMPONENT LIFECYCLE :

A component goes through, allowing code to run at specific moments during its existence.

  1. Covers phases like creation, update, and removal of a component.
  2. Helps manage side effects & resources efficiently.
  3. Improves application performance through controlled execution.

PHASES OF LIFECYCLE IN COMPONENT :

  1. MOUNTING.
  2. UPDATING.
  3. UN-MOUNTING.

MOUNTING :

The process of creating and inserting a component into the DOM for the first time in a React application. During mounting, React initializes the component, sets up its internal state, and inserts it into the DOM.

UPDATING :

The phase where a component re-renders in response to changes in its state or props, ensuring the UI reflects the latest data.

UN-MOUNTING :

The final phase of the lifecycle of the component, which is the phase of unmounting the component from the DOM.

Top comments (0)