What will be the output of the following code?
function App() {
return (
<ErrorBoundary>
<button
onClick={() => {
throw new Error();
}}
>
Click me
</button>
</ErrorBoundary>
);
}
Error caught, fallback UI shown
App crashes
Button works fine
No UI rendered
This question is part of this quiz :
Error Boundary and Debugging in React