3 ms·
You still need to use class components for error boundaries. https://reactjs.org/docs/error-boundaries.html https://reactjs.org/docs/error-boundaries.html
by tshaddox 4y ago
You still need to use class components for error boundaries.
https://reactjs.org/docs/error-boundaries.html https://reactjs.org/docs/error-boundaries.html
- ajkjk 4y agoYeah, this feels like a weird oversight.
- tshaddox 4y agoA bit weird, although it’s not clear how they would do it without class components. I guess it would probably look something like React.forwardRef.
- ajkjk 4y agoThey could provide a <ErrorBoundary> component as a built-in that just does what the current one does, but is implemented by the library.