Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Toast behaviour on adding toastId #1161

Open
Kumud246 opened this issue Oct 1, 2024 · 0 comments
Open

Bug in Toast behaviour on adding toastId #1161

Kumud246 opened this issue Oct 1, 2024 · 0 comments

Comments

@Kumud246
Copy link

Kumud246 commented Oct 1, 2024

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Adding toastId to toast() does not show the same toast() until the previous one is there in the DOM.

useEffect(() => { if (success) { toast.success('Message Success', { toastId: 'successMsg'}); } }, [success]);

This if condition is running if success is true but new toaster does not comes if toastId is there and already there is a toaster.

CodeSandbox example:
https://codesandbox.io/p/sandbox/priceless-wescoff-6czxmt

What is the expected behavior?
Should work same as it works when we don't add toastId, show toast message as many times it comes to toast.success('Message Success')

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React version- 18.2.0
react-toastify version - 9.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant