Skip to content

Instantly share code, notes, and snippets.

@sriram-palanisamy-hat
Created October 26, 2025 15:22
Show Gist options
  • Select an option

  • Save sriram-palanisamy-hat/6976aa98980b7c550ab64b4236a33aab to your computer and use it in GitHub Desktop.

Select an option

Save sriram-palanisamy-hat/6976aa98980b7c550ab64b4236a33aab to your computer and use it in GitHub Desktop.
Which Error Boundary catches the error
import * as React from 'react';
function App() {
return (
<ErrorBoundary name="boundary-1">
<A />
</ErrorBoundary>
)
}
function renderWithError() {
console.log('throw')
throw new Error('error');
}
function A() {
return <ErrorBoundary name="boundary-2">
{renderWithError()}
</ErrorBoundary>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment