react-error-notify is a React-Native and React error boundary component that helps catch and notify about component-level errors in your React applications. It integrates with Slack to send notifications about errors.
You can install react-error-notify via npm:
npm install react-error-notify
Wrap your application or any specific part of your UI where you want to catch errors with the <REN>
component:
import React from 'react';
import { REN } from 'react-error-notify';
function App() {
return (
<REN>
{/* Your application components */}
</REN>
);
}
export default App;
ReactNode - The child components to be wrapped by the
<REN>
component.
ReactNode (optional) - Custom fallback UI to be rendered when an error occurs.
Boolean (recommended) - Flag to enable/disable sending error notifications to Slack.
{ url: string } (required if
sendToSlack
is enabled) - Configuration object containing the Slack webhook URL.
Follow this documentation to create a slack app if you do not have a slack url: https://api.slack.com/messaging/webhooks
import React from 'react';
import { REN } from 'react-error-notify';
function App() {
return (
<REN fallbackComponent={<MyFallbackComponent />} sendToSlack slackConfig={{ url: 'your-slack-webhook-url' }}>
{/* Your application components */}
</REN>
);
}
export default App;
License This project is licensed under the MIT License - see the LICENSE file for details.