From 1e5a793051aaaebfcf9b165ae7968c0e39aed5d1 Mon Sep 17 00:00:00 2001 From: Talgat Minigaliev <36820511+RND332@users.noreply.github.com> Date: Fri, 19 Dec 2025 12:37:43 +0300 Subject: [PATCH] Modify onMutate signature to add context parameter Updated the onMutate function signature to include context. --- docs/framework/react/reference/useMutation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/framework/react/reference/useMutation.md b/docs/framework/react/reference/useMutation.md index adcd6bf9d0..60940ba5de 100644 --- a/docs/framework/react/reference/useMutation.md +++ b/docs/framework/react/reference/useMutation.md @@ -64,7 +64,7 @@ mutate(variables, { - Optional - defaults to `'online'` - see [Network Mode](../guides/network-mode.md) for more information. -- `onMutate: (variables: TVariables) => Promise | TOnMutateResult | void` +- `onMutate: (variables: TVariables, context: MutationFunctionContext) => Promise | TOnMutateResult | void` - Optional - This function will fire before the mutation function is fired and is passed the same variables the mutation function would receive - Useful to perform optimistic updates to a resource in hopes that the mutation succeeds