Skip to content

Instantly share code, notes, and snippets.

@owenconti
Created May 19, 2020 01:42
Show Gist options
  • Select an option

  • Save owenconti/f9194d3c093d4443517c6f9dd2a5b163 to your computer and use it in GitHub Desktop.

Select an option

Save owenconti/f9194d3c093d4443517c6f9dd2a5b163 to your computer and use it in GitHub Desktop.
React error boundaries
function SomeComponent() {
return (
<CustomErrorCatcher>
{invalidVariable}
</CustomerErrorCatcher>
);
}
function Root() {
return (
<CustomErrorCatcher>
<App />
</CustomErrorCatcher>
);
}
ReactDom.render(<Root />, document.getElementById('app'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment