tomchentw / react-toastr

React.js toastr component
https://tomchentw.github.io/react-toastr/
MIT License
619 stars 112 forks source link

Return reference to toastr instance so we can destroy them at will #140

Open JoshMcCullough opened 4 years ago

JoshMcCullough commented 4 years ago

toastr returns a reference to the resulting toastr object when you e.g. toastr.info(...), however, as far as I can tell there is no way to get this reference using react-toastr. Here is the relevant source: https://github.com/CodeSeven/toastr/blob/master/toastr.js#L69

It would be useful to be able to get a reference to the toast instance so we can do things such as pop a "Saving, please wait..." toast, and then destroy it and pop a "Your thing was successfully saved!" toast. Is it possible?