Skip to content

Commit 02f681d

Browse files
authored
docs(useMutation): clarify retry default value (TanStack#3159)
This makes the default value more apparent and adds `retry` and `retryDelay` to the example code.
1 parent 98fbec5 commit 02f681d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/src/pages/reference/useMutation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const {
2222
onMutate,
2323
onSettled,
2424
onSuccess,
25+
retry,
26+
retryDelay,
2527
useErrorBoundary,
2628
meta,
2729
})
@@ -60,7 +62,8 @@ mutate(variables, {
6062
- This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error
6163
- If a promise is returned, it will be awaited and resolved before proceeding
6264
- `retry: boolean | number | (failureCount: number, error: TError) => boolean`
63-
- If `false`, failed mutations will not retry by default.
65+
- Defaults to `0`.
66+
- If `false`, failed mutations will not retry.
6467
- If `true`, failed mutations will retry infinitely.
6568
- If set to an `number`, e.g. `3`, failed mutations will retry until the failed mutations count meets that number.
6669
- `retryDelay: number | (retryAttempt: number, error: TError) => number`

0 commit comments

Comments
 (0)