Notify the user for success/error or any other messages within the app


1.1.03 years ago3 years agoMinified + gzip package size for @breathecode/react-notifier in KB


React Notifier

React component for notifications on the fron end.


$ npm i --save @breathecode/react-notifier

How to use it

  1. Add the Notifier tag anywhere in your web app
     <Notifier />,
  2. Call the Notify function from anywhere else ```js

//notify for error Notify.error("Hey! There is an error");

//notify for success Notify.success("Everything is cool my brother");

## Customize notification

2) Call the Notify function from anywhere else
    const ModalComponent = ({ onConfirm }) => 
            <h1>Are you sure?</h1>
            <button onClick={()=>onConfirm(true)}>Yes</button>
            <button onClick={()=>onConfirm(false)}>No</button>

     * @param1: Wrapper css class 
     * @param2: Component to render it
     * @param3: callback when answered
     * @param4: timeout in millisecons (null for no timout)
    let noti = Notify.add('info', ModalComponent, (answer)=>{
        console.log("The user answer is: ", answer);
    }, 9999999999999);

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.