Add div
with id #toast
This div
is in position: absolute
, so don't forget to be relative to something else
ReactDOM.render(
<React.StrictMode>
<App />
<div id="toast"></div>
</React.StrictMode>,
document.getElementById('root')
)
import triggerToast from '../lib/toast/triggerToast'
triggerToast(title, message, toastType, duration)
triggerToast('Error', 'End of the world', 'error', 6000)