Open DonRyu opened 2 years ago
Hi! Can you create a Codesandbox/Stackblitz that reproduces this issue?
I encountered an issue like this as well. I'm using react query and on a mutation success call I would remove a toast and then show a success toast. About half the time the success toast just lingered and never disappeared.
But it works great after changing to toast.dismiss instead, thanks to OP for pointing that out :smile_cat:
Using toast.dismiss()
instead of toast.remove()
does temporarily solve the issue.
Using
toast.dismiss()
instead oftoast.remove()
does temporarily solve the issue.
I had this issue. It helped me.
whats the expected difference between dismiss and remove?
I encountered the same issue when doing the following:
toast.dismiss('someId')
toast.error('Message', { id: 'someId', duration: Infinity })
The initial dismiss call is there to make the user see that it's a new notification. Calling these in sequence causes any subsequent dismiss of the new message to not remove it from the list.
I am using Next.js
After Closing the custom toast message using
button onClick ( ( ) => toast.remove(t.id) )
toast.error(SEARCH_ERROR_MSG, { id: 'search_error' }); Never disappear...
The default duration for errpr is 2000 milliseconds... (If I don't use toast.remove(t.id) for toast.custom(toast.dimiss(t.id) , toast.error disappear well)