A simple and reusable React-Native error boundary component
npm install react-native-error-boundary



> A simple and reusable React-Native error boundary component 🐛
``bash`
yarn add react-native-error-boundary
- Installation
- Usage
- Recovering Errors
- Logging Errors
- Rendering a Fallback Component
- API
- ErrorBoundary
- FallbackComponent
- FAQ
These are the props that you can pass to the ErrorBoundary component:
| Property | Type | Required | Default |
|---------------------|-------------------|----------|---------------------|
| Children | React.Children | true | |FallbackComponent
| | React.Component | false | FallbackComponent |onError
| | Function | false | |
#### Children
Any children that can throw an error.
#### FallbackComponent
The fallback component that will be rendered after catching an error.
By default the library comes with a built-in component.
#### onError
A function that receives two arguments:
- error: The error catched by the component.stackTrace
- : The stacktrace of the error.
`js`
onError(error: Error, stackTrace: string): void
These are the props that the FallbackComponent receives:
| Property | Type | Default |
|------------|------------|---------|
| error | Error | |Function
| resetError | | |
#### error
The error object.
#### resetError
A function to reset the error state. You'll want to call this function to recover from the error state.
`js``
resetError(): void
src='https://user-images.githubusercontent.com/7629661/111866027-bc158e00-896a-11eb-8140-cfdc5d19527c.gif'
alt='react-native-error-boundary'
width='354px'
/>