Closed utxo-detective closed 8 years ago
Okay, I was able to figure it out and your code is fine. I needed to pass an anonymous function like so
this.refs.toastContainer.success(
'this is a message',
'title',
{ closeButton: true, handleOnClick: function() { this.redirect(sentence.url) }
);
hope this helps anyone with the same problem. Closing the issue
I would like to add a click listener on a ToastMessage so I can link to other parts of my website.
When passing handleOnClick as a prop like this:
the click callback runs when the toast appears, not when the toast is clicked on. I beleive the reason is on line 91 of ToastContainer.js
Shouldn't the handleOnClick be passed down to the ToastMessage instead of running on creation? If I am doing something wrong, let me know. If this is a bug, I am happy to make a pr