A

Admin • 833.24K Points
Coach

Q. Which React component lifecycle method is called before rendering?

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

Explanation by: Admin

getDerivedStateFromProps is called before render and helps update state based on props.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.