Notifications
Call it to create a notification from anywhere, even outside React. Make sure you add the <Notification/>
component to your app first.
#
Available Notification optionsYou can provide NotificationOptions as the second argument. They will overwrite all options received from <Notifiction/>
.
#
Creating a notification#
Blank#
Success#
Error#
Loading#
PromiseThis shorthand is useful for mapping a promise to a notify. It will update automatically when the promise resolves or fails.
#
Advanced#
ConfirmA custom notification used in user confirmation dialogs. Can be helpful for asynchronous operations.
#
Dismiss notification programmatically#
Dismiss all notifications at one#
Update an existing notification#
Render JSX custom contentYou can provide a React component instead of text.
#
AdvancedYou can also supply a function that receives the notification as an argument, giving you access to all properties. This allows you to access the notification id, which can be used to add a dismiss button.
#
ReferenceUnder the hood, we are using react-hot-toast for our notifications UI.