react-errbo
v2.3.0
Published
React Error Boundary Package
Downloads
4
Readme
react-errbo
React Error Boundary Package
Badges
Installation
Install react-errbo with npm
npm install --save-dev react-errbo
#or
yarn add -D react-errbo
Usage/Examples
import ErrorBoundary from 'react-errbo';
const App = () => {
return (
<ErrorBoundary onError={() => alert('An error occured')}>
<button
onClick={() => {
throw new Error('a');
}}
>
Throw Error
</button>
</ErrorBoundary>
);
};