Type Alias: MutationResult<TFuncName, TData, TError, TVariables, TContext>
MutationResult<
TFuncName
,TData
,TError
,TVariables
,TContext
>:Omit
<UseMutationResult
<TData
,TError
,TVariables
,TContext
>,"mutateAsync"
> &{ [P in TFuncName]: UseMutationResult<TData, TError, TVariables, TContext>["mutateAsync"] }
See Tanstack Query - useMutation returns.
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
TFuncName extends string | - | The name of the function that mutates. |
TData | - | The data returned. |
TError | - | The error returned. |
TVariables | - | The variables used in the mutation. |
TContext | unknown | The context used in the mutation. |
See
Tanstack Query - useMutation
Example
mutateAsync
is renamed according to theTFuncName
and therefore not included in the result.
const {
data,
error,
isError,
isIdle,
isPending,
isPaused,
isSuccess,
failureCount,
failureReason,
mutate,
- mutateAsync,
reset,
status,
submittedAt,
variables,
} = useMutationHook();