diegoddox/react-redux-toastr

No support for multiple toastr instances

gowikel opened this issue · 1 comments

Hi on our application we are using two instances of a toastr component. One of them is global and is instantiated straight away in the root component. But our users can see a portion of the application in fullscreen and we instantiate another toastr component when we move to fullscreen. We realised that when the second one unmounts, the global one stops working. Inspecting the code we saw that the unmounting toastr removes all listeners breaking the communication of the global one.

Hi @gowikel, the easiest way to solve this will be to add another prop like removeEventEmitterOnUnmount here which is default to true and in componentWillUnmount we could check for it and preventing from removing the listeners based on that.