Do you want to request a feature or report a bug?
feature
What is the current behavior?
No limited on showing
What is the expected behavior?
Props to limited toast showing
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React v16.7
Hello @popugang,
You can already pass a component and limit the output. For instance, lets do it with css and a functional component.
.limited-output{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
}
// somewhere in your app
toast(() => (
<div className="limited-output">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt rem odit quis quaerat. In dolorem
praesentium velit ea esse consequuntur cum fugit sequi voluptas ut possimus voluptatibus deserunt
nisi eveniet!Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem voluptates vel dolorum
autem ex repudiandae iste quasi. Minima explicabo qui necessitatibus porro nihil aliquid deleniti ullam
repudiandae
</div>
);
You can find more about rendering a component here
@fkhadra You do not understand me. I want to limit the notification showing.
i want props showCount={3} and watching only 3 toast on the site
Hello @popugang,
You mean limit the number of toast displayed at the same time ?
Hello @popugang,
You mean limit the number of toast displayed at the same time ?
exactly
@fkhadra what can do with it ?
@fkhadra reopen issue please
@fkhadra thank you very much
Will be cool to have a buffer that will store delayed notifications until we can show them
It would be awesome if this is available as an option in the toast container
@fkhadra Any progress on that so far? Maybe, you would need additional help?
I need this feature too, to me it would be super cool to have n toasters and having the old ones to close automatically as the new ones appear!
I also need this feature
I would love such a feature as well. Have to handle this myself for now.
I faced same issue
Hello guys,
I'm rewriting the library, maybe I'll port it to typescript. The goal is to reduce the bundle size and also to lower the barrier for newcomers. I'll see how to add this feature.
also i need this feature
also i need this feature
+1; I'd love to have a maxCount I can pass to toast.configure()
Hey, a v6 release candidate is available including that feature. You can try it here
@fkhadra great release, thank you so much. I have a scenario that need to display the latest limited toasts, and hide the oldest toasts, as my site need to push the latest real-time messages to users, queued toasts may delay some important informations... is it necessary support 2 modes for count limit? LRU and Queued?
@zslucky the v6(not RC) is now live. Maybe this can help https://fkhadra.github.io/react-toastify/limit-the-number-of-toast-displayed/#how-to-clear-the-waiting-queue
@fkhadra thanks, this can be a solution. 馃憤
Most helpful comment
Hello guys,
I'm rewriting the library, maybe I'll port it to typescript. The goal is to reduce the bundle size and also to lower the barrier for newcomers. I'll see how to add this feature.