Skip to content

carlchrhaensel/react-app-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-app-notifier

Usage

Installation

npm install react-app-notifier

Add NotificationProvider

root.render(
    <React.StrictMode>
        <NotificationProvider>
            <App/>
        </NotificationProvider>
    </React.StrictMode>
);

Show notification

const ExampleComponent: FC = () => {
    const dispatchNotification = useNotification();

    const showNotification = () => {
        dispatchNotification({message: 'An example text', timeout: 10, type: 'error'});
    }
    
    return (
        <button onClick={showNotification}>click me</button>
    );
}

Credits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors