react-hot-toast
react-hot-toast copied to clipboard
Add support for multiple toasters
This PR implements the ability to have multiple toasters at once.
// Create a toaster with a custom id
<Toaster id="custom-toaster" />;
// Create a toast within the new toaster
toast.success('Nice toast!', {
toasterId: 'custom-toaster',
});
<Toaster /> // Default toaster
<div>
<Toaster
toasterId="area1"
containerStyle={{ position: 'absolute' }}
/>
</div>
<div>
<Toaster
toasterId="area2"
containerStyle={{ position: 'absolute' }}
/>
</div>
Related issue
Closes #158