Skip to content

Commit 2dbc134

Browse files
committed
onMutate return type change 'Promise<TContext> | Promise<undefined> | TContext | undefined'
1 parent 01d2f2d commit 2dbc134

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ export interface MutationOptions<
472472
mutationFn?: MutationFunction<TData, TVariables>
473473
mutationKey?: MutationKey
474474
variables?: TVariables
475-
onMutate?: (variables: TVariables) => Promise<TContext> | TContext | undefined
475+
onMutate?: (variables: TVariables) => Promise<TContext> | Promise<undefined> | TContext | undefined
476476
onSuccess?: (
477477
data: TData,
478478
variables: TVariables,

src/react/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export interface UseMutationOptions<
7575
TContext = unknown
7676
> {
7777
mutationKey?: string | unknown[]
78-
onMutate?: (variables: TVariables) => Promise<TContext> | TContext | undefined
78+
onMutate?: (variables: TVariables) => Promise<TContext> | Promise<undefined> | TContext | undefined
7979
onSuccess?: (
8080
data: TData,
8181
variables: TVariables,

0 commit comments

Comments
 (0)