toastAction
Runs a toast action's callback on click.
import { toastAction } from "@sdxc/ui/app";Signature
toastAction(toaster: Toaster<unknown>, id: string, onAction: (() => void) | undefined): MixinDescriptor<HTMLButtonElement>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
toaster | Toaster<unknown> | Yes | |
id | string | Yes | |
onAction | (() => void) | undefined | Yes |
Examples
<button mix={[toastAction(toaster, id, restore)]}>Undo</button>