- toast(...args): string
Parameters
Rest
...args: [message: Message, opts?: Partial<Pick<Toast,
| "id"
| "position"
| "className"
| "style"
| "icon"
| "duration"
| "ariaProps"
| "iconTheme">>]
Returns string
Properties
custom
custom: ToastHandler
error
error: ToastHandler
loading
loading: ToastHandler
success
success: ToastHandler
Methods
dismiss
- dismiss(toastId?): void
Returns void
promise
- promise<T>(promise, msgs, opts?): Promise<T>
Parameters
- promise: Promise<T>
- msgs: {
error: ValueOrFunction<Renderable, any>;
loading: Renderable;
success: ValueOrFunction<Renderable, T>;
}error: ValueOrFunction<Renderable, any>
loading: Renderable
success: ValueOrFunction<Renderable, T>
Optional
opts: DefaultToastOptions
Returns Promise<T>
Export of
toast
fromreact-hot-toast/headless
, which is an API for creating notifications,⚠️ but without the
remove
method ⚠️.See the documentation for more details.