react-notification-modal
A delightful, easy to use and highly configurable component to help you notify your users out of the box. Specially for the server side exceptions, messages and Login Modal.
Install
npm install --save react-notification-modal
Usage
import React Component from 'react' import Notifiction from 'react-notification-modal'import 'react-notification-modal/dist/index.css' { return <Notifiction /> }
SASS
SASS
files are located in react-notifications-modal/dist
Render react-notification-modal
at the top of your application so that it does not conflict with other absolutely positioned DOM elements.
const App = return <div ="app-container"> <ReactNotification /> <Application /> </div> ;
Import store
where needed - will be used to access addNotification
and removeNotification
API methods
;
Then call addNotification
and watch the magic happens
store;
axios
Add axios.interceptors to globally handle errors.
import store from 'react-notification-modal'; axiosinterceptorsresponse;
License
MIT © abdulwahhabkhan