ButtonClickable()function
ButtonClickable({
onClick,
disabled = !onClick,
title,
children = "Click",
className,
}: StylableClickableProps): ReactElement| Param | Type | |
|---|---|---|
props | StylableClickableProps | Props for a clickable that also accepts a className for styling. required |
.className | string |
| Return | |
|---|---|
ReactElement |
Render a <button> element that runs its onClick handler through a BusyStore and shows a loading spinner while busy.
- Notifies the user of the handler's returned value (success) or thrown value (error).
- Disabled and ignores clicks while a previous click is still pending.
Examples
<ButtonClickable onClick={save} className="btn">Save</ButtonClickable>