react-hot-toast
react-hot-toast copied to clipboard
Clicking dismiss sometimes doesn't work for 1 second
Because clicking on a dismiss button triggers addToRemoveQueue
, such action may take 1 second to complete which is unexpected from a UX standpoint. I'm not sure why it isn't always 1 second, sometimes it is instantaneous.
const addToRemoveQueue = (toastId: string) => {
if (toastTimeouts.has(toastId)) {
return;
}
const timeout = setTimeout(() => {
toastTimeouts.delete(toastId);
dispatch({
type: ActionType.REMOVE_TOAST,
toastId: toastId,
});
}, 1000);
[...]
Bump. This is irritating.
Same issue there
Even I faced same issue. Temporarily replaced toast.dismiss(id) with toast.remove(id).
I have the same delay after toast.dismiss(id) in toast.custom