emilkowalski / sonner

An opinionated toast component for React.

Home Page:https://sonner.emilkowal.ski

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

hyoban opened this issue Β· comments

Describe the feature / bug πŸ“:

Did you do this on purpose?

sonner/src/index.tsx

Lines 377 to 379 in bc74b2d

{toast.jsx || React.isValidElement(toast.title) ? (
toast.jsx || toast.title
) : (

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.