react-hot-toast
react-hot-toast copied to clipboard
Prevent stacking
I want to prevent the default notifications stacking on one another (I'm managing that on my own). Is there a way to do that in this lib?
Hi @SaadBazaz, yes there is a way to prevent multiple toasts, I found in the documentation you need to add an object with id on it and then only one will be rendered.
Here's an example: toast.error('Error! Attachment must be an Excel file', { id: 'attachment' });
You can use an id like mentioned above to avoid duplication. If you want a max limit of toasts you can have a look here: #31