Skip to content

Commit e8cac35

Browse files
committed
allow to specify TData for update
1 parent f33823d commit e8cac35

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/core/toast.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ toast.isActive = (id: Id) => {
233233
return isToastActive;
234234
};
235235

236-
toast.update = (toastId: Id, options: UpdateOptions = {}) => {
236+
toast.update = <TData = unknown>(
237+
toastId: Id,
238+
options: UpdateOptions<TData> = {}
239+
) => {
237240
// if you call toast and toast.update directly nothing will be displayed
238241
// this is why I defered the update
239242
setTimeout(() => {

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ interface CommonOptions {
166166
/**
167167
* @deprecated
168168
* ⚠️ Will be removed in the next major release. You can pass a react component with you handler instead.
169-
*
169+
*
170170
* Fired when clicking inside toaster
171171
*/
172172
onClick?: (event: React.MouseEvent) => void;

0 commit comments

Comments
 (0)