A

Admin • 833.24K Points
Coach

Q. Which lifecycle method is called when a component is first added to the DOM in class components?

  • (A) componentDidMount
  • (B) componentWillUnmount
  • (C) shouldComponentUpdate
  • (D) render
  • Correct Answer - Option(A)
  • Views: 34
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin

componentDidMount runs after the first render.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.