timolins / react-hot-toast

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

How can we use toast.custom but with a promise? #147

Open optimbro opened 2 years ago

optimbro commented 2 years ago

I check the documentation about styling with tailwindcss, but I was looking for an example with toast.custom(t) and having a promise?

timolins commented 2 years ago

This is currently not possible. My suggestion would be to create a custom toaster, which will also apply for toast.promise().

You can find more information + example (with goober/style-components) here: https://github.com/timolins/react-hot-toast/issues/67#issuecomment-983611798

This example with TailwindCSS + HeadlessUI (for easy transition animations) could be relevant as well: https://codesandbox.io/embed/react-hot-toast-tailwindcss-headless-ui-qvjri

Does this work for you?