@alesmenzel/error-boundary
v1.0.1
Published
React Error Boundary Component
Downloads
7
Readme
Error Boundary
Simple implementation of React's Error Boundary.
Installation
npm install @alesmenzel/error-boundary
Usage
function App({ name }) {
return (
<ErrorBoundary
onError={(error, info) => /* optionally, send to your favourite logger */ }
fallback={({error, retry}) => <NoAvatar />}
// or
fallback={<NoAvatar />}
>
<Avatar name={name}/>
</ErrorBoundary>
)
}