emilkowalski / sonner

An opinionated toast component for React.
https://sonner.emilkowal.ski
MIT License
7.69k stars 237 forks source link

Action/Cancel button can not be used with a custom toast #445

Open hyoban opened 3 weeks ago

hyoban commented 3 weeks ago

Describe the feature / bug 📝:

Did you do this on purpose?

https://github.com/emilkowalski/sonner/blob/bc74b2d62c7e0e7533a4a21c7597acefa837f231/src/index.tsx#L377-L379

Steps to reproduce the bug 🔁:

toast(<div>A custom toast with default styling</div>, {
  action: {
    label: "Action",
    onClick: () => console.log("Action!"),
  },
});

I am willing to submit a pull request for this change.