Why must error boundaries be class components?
Component Patterns
Audio flashcard · 0:10Nortren·
Why must error boundaries be class components?
0:10
As of current React versions, only class components can implement the componentDidCatch and getDerivedStateFromError lifecycle methods required to catch errors. There is no hook equivalent yet.