Skip to content

Commit

Permalink
docs: Update mutations.md (#8105)
Browse files Browse the repository at this point in the history
  • Loading branch information
go-sagar authored Oct 1, 2024
1 parent 0ccd60a commit b663383
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/framework/react/guides/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ There is a slight difference in handling `onSuccess`, `onError` and `onSettled`
```tsx
useMutation({
mutationFn: addTodo,
onSuccess: (data, error, variables, context) => {
onSuccess: (data, variables, context) => {
// Will be called 3 times
},
})

const todos = ['Todo 1', 'Todo 2', 'Todo 3']
todos.forEach((todo) => {
mutate(todo, {
onSuccess: (data, error, variables, context) => {
onSuccess: (data, variables, context) => {
// Will execute only once, for the last mutation (Todo 3),
// regardless which mutation resolves first
},
Expand Down

0 comments on commit b663383

Please sign in to comment.