Closed OnkelTem closed 1 year ago
Yep, there you go: https://react-hot-toast.com/docs/toast#update-an-existing-toast
toast("123", {
id: "count"
})
toast("456", {
id: "count"
})
// or
const toastId = toast("123")
toast("456", {
id: toastId
})
Thank you very much @timolins !
Meanwhile, I've also discovered the purpose of the useToaster()
hook which can be used to create any render, including filtering or updating one.
Is there a way to update an existing toast?
For example, if an error happens more than once, it shouldn't be repeated; instead, the previous one should be updated with a counter. It's similar to what browsers do when printing messages in the console.
I don't find this information in the docs or here in the issues.