xxxxxxxxxx
npm install --save react-toastify
//Make sure to import the necessary files:
import "react-toastify/dist/ReactToastify.css";
import { ToastContainer, toast } from "react-toastify";
xxxxxxxxxx
// Display an info toast with no title
toastr.info('Are you the 6 fingered man?')
xxxxxxxxxx
new Toast({
message: 'This is an example with custom buttons',
type: 'success',
customButtons: [
{
text: 'Refresh the page',
onClick: function() {
window.location.reload();
}
},
{
text: 'Follow @ireaderinokun',
onClick: function() {
window.open('https://twitter.com/ireaderinokun');
}
}
]
});