Q. Which method can be used to handle errors in React class components?

  • (A) componentDidCatch
  • (B) componentWillCatch
  • (C) componentDidUpdate
  • (D) componentError
πŸ’¬ Discuss
βœ… Correct Answer: (A) componentDidCatch
Explanation: componentDidCatch is a lifecycle method used to catch errors in class components.
Explanation by: Mr. Dubey
componentDidCatch is a lifecycle method used to catch errors in class components.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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