Cogoport / cogo-toast

Beautiful, Zero Configuration, Toast Messages for React. Only ~ 4kb gzip, with styles and icons
https://cogoport.github.io/cogo-toast
MIT License
673 stars 1 forks source link

Pass onHide callback option to the Toast components #76

Closed y1n0 closed 2 years ago

y1n0 commented 3 years ago

This solves issue #60.

We can pass an onHide: (id, position) => {} to be called in the end of the hiding mechanism.

const { hide } = cogoToast.success('This is a success message.', {
  onClick: () => {
    hide();
  },
  onHide: (id, position) => {
    console.log(`hid toast ${id}`);
  }
});
ankit-indexnine commented 2 years ago

This onHide callback doesn't seem to be working. I tried logging a few console messages inside it, but none of them were printed.