timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.79k stars 331 forks source link

Set duration for dismiss-able toast #77

Closed AmirHosseinKarimi closed 3 years ago

AmirHosseinKarimi commented 3 years ago

Hi, Looks like when set duration of toast (for my case toast.error()) it's not dismiss-able by click on toast.

toast.error(
  "oh, error!",
  { duration: 1000 * 60 }
);
timolins commented 3 years ago

You are right, toasts are currently not dismissable by default. You'd have to implement your own close button for now. You can read more about it here: https://react-hot-toast.com/docs/toast-bar#add-custom-content

I have plans to add a default dismiss option. The related issue is #7.

Absleepy commented 2 years ago

@timolins I still don't see any option for closing on click.