Cogoport/cogo-toast

Hide is not a function

Closed this issue · 1 comments

Hi,

got the following code

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

getting the following error
TypeError: hide is not a function
I'm on
"react": "^16.9.0",
"cogo-toast": "^4.2.1"

This API was changed in the new version, in favour of #28

Try this instead...

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