0.0.6 • Published 7 years ago
try-catch-component v0.0.6
try-catch-component
A React component wrapper that catches errors.
Installation
$ npm install try-catch-component
Usage
ES2015
import {PureComponent} from 'react';
import tryCatchComponent from 'try-catch-component';
class MyComponent extends PureComponent {
render() {
throw new Error('Oh no!')
}
renderFallback(e) {
return (
<span>Something went wrong</span>
);
}
}
export default tryCatchComponent(MyComponent);
API
TODO...
License
MIT