const {
data,
error,
isError,
isIdle,
isPending,
isPaused,
isSuccess,
failureCount,
failureReason,
mutate,
mutateAsync,
reset,
status,
submittedAt,
variables,
} = useMutation(
{
mutationFn,
gcTime,
meta,
mutationKey,
networkMode,
onError,
onMutate,
onSettled,
onSuccess,
retry,
retryDelay,
scope,
throwOnError,
},
queryClient,
)
mutate(variables, {
onError,
onSettled,
onSuccess,
})
const {
data,
error,
isError,
isIdle,
isPending,
isPaused,
isSuccess,
failureCount,
failureReason,
mutate,
mutateAsync,
reset,
status,
submittedAt,
variables,
} = useMutation(
{
mutationFn,
gcTime,
meta,
mutationKey,
networkMode,
onError,
onMutate,
onSettled,
onSuccess,
retry,
retryDelay,
scope,
throwOnError,
},
queryClient,
)
mutate(variables, {
onError,
onSettled,
onSuccess,
})
Parameter1 (Options)
Parameter2 (QueryClient)
Returns
“This course is the best way to learn how to use React Query in real-world applications.”—Tanner LinsleyGet the course