useMutation

· abundance's blog


 1const {
 2  data,
 3  error,
 4  isError,
 5  isIdle,
 6  isPending,
 7  isPaused,
 8  isSuccess,
 9  failureCount,
10  failureReason,
11  mutate,
12  mutateAsync,
13  reset,
14  status,
15  submittedAt,
16  variables,
17} = useMutation({
18  mutationFn,
19  gcTime,
20  meta,
21  mutationKey,
22  networkMode,
23  onError,
24  onMutate,
25  onSettled,
26  onSuccess,
27  retry,
28  retryDelay,
29  scope,
30  throwOnError,
31})
32
33mutate(variables, {
34  onError,
35  onSettled,
36  onSuccess,
37})

Options

Returns