Skip to content

Commit

Permalink
fix(types): change types for useMutation context in onSuccess (#3654)
Browse files Browse the repository at this point in the history
changes context to optional in onSuccess callback
  • Loading branch information
Sunil Hari committed May 29, 2022
1 parent 5848fab commit 9f6c992
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/mutation.ts
Expand Up @@ -178,7 +178,7 @@ export class Mutation<
this.options.onSuccess?.(
data,
this.state.variables!,
this.state.context!
this.state.context
)
)
.then(() =>
Expand Down
2 changes: 1 addition & 1 deletion src/core/types.ts
Expand Up @@ -548,7 +548,7 @@ export interface MutationOptions<
onSuccess?: (
data: TData,
variables: TVariables,
context: TContext
context: TContext | undefined
) => Promise<unknown> | void
onError?: (
error: TError,
Expand Down

1 comment on commit 9f6c992

@vercel
Copy link

@vercel vercel bot commented on 9f6c992 May 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.