React

Introduction to React - The componentDidMount life...

19.

What is the purpose of the componentDidMount lifecycle method in a React component?

To fetch data from an API

To perform initial setup that requires DOM nodes

To handle state updates and re-render the component

To clean up any resources or event listeners before the component is unmounted