-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Toast - Clear and then show doesn't clear existing messages #2668
Comments
omerts
added a commit
to omerts/primereact
that referenced
this issue
Mar 2, 2022
Also I know Messages has a replace function which maybe you can add which will call clear and add the new message in one method call as a bonus? |
This is actually fixed in 8.0.0-rc1 now that it has been switched to Hooks. |
melloware
added a commit
to melloware/primereact
that referenced
this issue
May 25, 2022
OK I have added a |
melloware
added a commit
to melloware/primereact
that referenced
this issue
May 25, 2022
melloware
added a commit
that referenced
this issue
May 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a ...
Codesandbox Case (Bug Reports)
https://codesandbox.io/embed/primereact-test-forked-kf580b?fontsize=14&hidenavigation=1&theme=dark]
Current behavior
Use Toast's clear method and then show, doesn't clear existing messages, as setState is an async operation, so show is using a stale messages state, and thus returns old messages.
Expected behavior
Messages should be cleared up clear regardless of show being used afterwards.
Minimal reproduction of the problem with instructions
See codesandbox demo
PrimeReact version:
6.0.1
Language: all
The text was updated successfully, but these errors were encountered: