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

  • (A) componentDidMount
  • (B) componentWillUnmount
  • (C) render
  • (D) getDerivedStateFromProps
πŸ’¬ Discuss
βœ… Correct Answer: (D) getDerivedStateFromProps
Explanation: getDerivedStateFromProps is called before render and helps update state based on props.
Explanation by: Mr. Dubey
getDerivedStateFromProps is called before render and helps update state based on props.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
83
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
90%
Success Rate