Closed mclean25 closed 2 years ago
If I change toast.custom()
to toast()
, the lag disappears but the styling breaks.
This is due to the fact that toast.custom()
has no animations per default, but leaves the element in the DOM for 1s to play your own.
I can see you are using animate-enter
& animate-leave
from the example page, which are not part of Tailwind by default.
You can find the definition here: https://github.com/timolins/react-hot-toast/blob/main/site/tailwind.config.js#L21-L39
The issue should be fixed by adding these animation, or by providing your own.
Issue #116 talks about adding default animations to toast.custom()
. Feel free to voice your opinion there.
I have the same issue. I'm not using tailwind... just custom divs. is it possible to just hide the toast.custom() on close without any animation or waiting for 1s before closing? it's really frustrating...
🙏 Please can we have an option of those default animations to custom toasts 🙏
I am also experiencing this problem. Is there any solution for this? I am not using Tailwind but custom divs with css.
When I use
toast.custom()
, there's significant lag between firing thetoast.dismiss()
and the toast actually being dismissed in the DOM. See this video below:https://user-images.githubusercontent.com/7105182/142970722-cbccb01b-91a7-4e1a-8079-9fffab205aef.mp4
Code
test.tsx
successToast.tsx
_app.tsx