Q. How do you handle errors in React components?
β
Correct Answer: (A)
Using error boundaries with componentDidCatch lifecycle method
Explanation: Error boundaries catch rendering errors and display fallback UI.