Question
What are the two key lifecycle methods for React Error Boundaries?
Asked by: USER2456
66 Viewed
66 Answers
Responsive Ad After Question
Answer (66)
The two key lifecycle methods for React Error Boundaries are `getDerivedStateFromError(error)` and `componentDidCatch(error, info)`. `getDerivedStateFromError` returns an object to update state, and `componentDidCatch` is called after an error has been found.