Loading toast is removed before resolving the promise.
See original GitHub issueI noticed a weird behavior when running a promise that takes fairly long (about 30s) the loading toast is automatically dismissed even before resolving the promise, when it’s resolved the success toast appears.
Can you reproduce this? Try having a promise that takes about 30 or 40 seconds to execute.
toast.promise(subtitlesPromise, {
loading: 'Generating your subtitles, please wait...',
success: 'Subtitles generated!',
error: 'Error generating subtitles.',
});
Thanks Timo for this awesome library!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Handling promises | React-Toastify - GitHub Pages
The library exposes a toast.promise function. Supply a promise or a function that return a promise and the notification will be updated if...
Read more >How to use react-toastify promise in axios - Stack Overflow
According to toast API https://fkhadra.github.io/react-toastify/promise/ the syntax should be
Read more >How to use react-hot-toast with async await Axios call #40
postVersionBulkAction(params) toast.promise(promise, { loading: 'Saving. ... and I have succesfully removed thousands of lines of redux ...
Read more >toast() API
Toasts will auto-remove after 1 second by default. Dismiss a single toast. const toastId = toast.loading( ...
Read more >Create smoking hot toast notifications in React with ... - Daily.dev
It maps the Promise to the notification used and updates automatically when the Promise is resolved or failed. You can give proper arguments...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, sorry for the delay. Currently planing out v1.1 which includes quite a few things I want to get right. I’ll hope to release in the next couple of days.
Any updates on this? @timolins