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

Close toast through onClick function #16

Closed hasnatnayeem closed 5 years ago

hasnatnayeem commented 5 years ago

Is there any way I can close the toast when user clicks on it?

anmdotdev commented 5 years ago

Merged in #17

Upgrade to v3.1.0. hide function passed as a param in onClick.

  cogoToast.success('This is a success message.', {
    onClick: (hide) => {
        hide();
    },
  });