Uses react-native-error-boundary package and add custom alert on fallback with retry and cancel option.
Installation
yarn add react-native-error-boundary-alert
or
npm i react-native-error-boundary-alert --save
API
CustomErrorBoundary
isRequired if there is a * in the name field
name | Proptypes | Description |
---|---|---|
goBack * | func | void |
handleError * | func | void |
children * | Node | component elements content |
Example
import CustomErrorBoundary from 'react-native-error-boundary-alert';
const handleError = (error) => {
console.error(error);
};
const goBack = () => {
// React native navigation
navigation.goBack();
};
<CustomErrorBoundary goBack={goBack} handleError={handleError}>
<Text>My component..</Text>
</CustomErrorBoundary>
Contact
gmail: shmuelpick1999@gmail.com