1

How can i prevent displaying duplicates toast in react-toastify. I have setTimeout function that call an api every 5 seconds when token expired ,It's return expired token in toast.err. I wanna to not display a lot of toast for every call

sokida
  • 433
  • 1
  • 8
  • 21

1 Answers1

4

You just need to provide a custom id to your toasts if id will remain same it wont duplicate.

Reference

Vivek Sharma
  • 531
  • 6
  • 20