limit total number of toasts
See original GitHub issueHey! Awesome library. Something that would be useful for me is an option to set the maximum number of visible toasts, that will automatically dismiss the oldest one when the maximum is reached.
I could do that with useToaster
and a filter but then I would have to replicate everything else <Toaster />
already does, so I would prefer not to.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Toast / How To / Restrict the maximum number of Toasts to show
Restrict the maximum number of Toasts to show in React Toast component. You can restrict the maximum toast count by event callback function....
Read more >Limit the number of toast displayed | React-Toastify
Limit the number of toast displayed. Notifications are useful to get the attention of the user. But displaying too many of them can...
Read more >Is there a limit to the amount of displayable Toasts?
Yes, Toasts are queued and there is a limit of 50 Toasts, you can see the check for it in NotificationManagerService class if...
Read more >[UWP]Length limits to number of lines and characters ... - MSDN
Toasts can only have up to 3 text elements. Sorry for the confusion in the article, we'll work on updating it to make...
Read more >Rate limiting - - Developer guide - Toast APIs
The global rate limit limits the total number of requests that an API client can make across all APIs collectively. For example, if...
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
You can achieve by using
useToasterStore()
&useEffect()
. We can read the state of all toasts, and dismiss them if our limit is reached.Check out this CodeSandbox example.
According to the demand, it’s time for a proper API. Will look into this for the next release.