Skip to content

Commit bdec357

Browse files
authored
docs: Modify onMutate signature to add context parameter (#9982)
Updated the onMutate function signature to include context.
1 parent 7a3990e commit bdec357

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/framework/react/reference/useMutation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ mutate(variables, {
6464
- Optional
6565
- defaults to `'online'`
6666
- see [Network Mode](../guides/network-mode.md) for more information.
67-
- `onMutate: (variables: TVariables) => Promise<TOnMutateResult | void> | TOnMutateResult | void`
67+
- `onMutate: (variables: TVariables, context: MutationFunctionContext) => Promise<TOnMutateResult | void> | TOnMutateResult | void`
6868
- Optional
6969
- This function will fire before the mutation function is fired and is passed the same variables the mutation function would receive
7070
- Useful to perform optimistic updates to a resource in hopes that the mutation succeeds

0 commit comments

Comments
 (0)