# react-slack-notification #### React Slack Notification is a lightweight package, Send messages to a Slack channel directly from your react app. [](http://nodejs.org/download/) [](https://www.npmjs.com/package/react-slack-notification) [](https://standardjs.com) ## Install ```bash npm install --save react-slack-notification ``` OR ```bash yarn add react-slack-notification ``` ## Usage #### Send your error logs directly to the slack channel without third party integration. ```jsx import notifyToSlackChannel from 'react-slack-notification'; class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false }; } static getDerivedStateFromError(error) { // Update state so the next render will show the fallback UI. return { hasError: true }; } componentDidCatch(error, errorInfo) { // Log the error to a slack channel notifyToSlackChannel('https://hooks.slack.com/services/xxxxxxxxxxxxx/example/webhook', error); } render() { if (this.state.hasError) { // You can render any custom fallback UI return
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.