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: v11: can't hide toast after changing route #1194

Open
spradlin-dev opened this issue Dec 22, 2024 · 1 comment
Open

BUG: v11: can't hide toast after changing route #1194

spradlin-dev opened this issue Dec 22, 2024 · 1 comment

Comments

@spradlin-dev
Copy link

spradlin-dev commented Dec 22, 2024

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

What is the current behavior?
If you display a toast, then change routes multiple times in quick succession (like by clicking around through the navigation), react-toastify will copy any displayed toasts for the new route. As it does this for multiple routes, it is very easy for react toastify to lose track of the toast that is currently displayed, then it becomes impossible to hide because:

Firefox: can't access property "removalReason", c.get(...) is undefined
Chrome: Uncaught TypeError: Cannot set properties of undefined (setting 'removalReason')
Safari: TypeError: undefined is not an object (evaluating 'c.get(u).removalReason = D')

at
image

What is the expected behavior?
Toast is always closeable, and will still close itself when its timer runs out

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react 18.3.1
react-toastify ^11.0.2
Firefox on MacOS AND Chrome on MacOS AND Safari on MacOS

@fkhadra
Copy link
Owner

fkhadra commented Dec 23, 2024

@spradlin-dev could you reproduce the issue in stackblitz?
Where is your ToastContainer rendered?

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

2 participants