Simple implementation of React's Error Boundary.
npm install @alesmenzel/error-boundary
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>
)
}