What happens when componentDidCatch() is removed in the following code?
function App() {
return (
<ErrorBoundary>
<button
onClick={() => {
throw new Error();
}}
>
Click me
</button>
</ErrorBoundary>
);
}
Error still caught, not logged
App crashes
Error not caught
App re-renders
This question is part of this quiz :
Error Boundary and Debugging in React