Skip to content

Commit cb67aea

Browse files
authored
Add curly brackets to mutation example for TS
Adding curly brackets to arrow function which "disables" the implicit return value for TypeScript users.
1 parent 92435c7 commit cb67aea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/src/pages/guides/updates-from-mutation-responses.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ When dealing with mutations that **update** objects on the server, it's common f
99
const queryClient = useQueryClient()
1010

1111
const mutation = useMutation(editTodo, {
12-
onSuccess: data => queryClient.setQueryData(['todo', { id: 5 }], data),
12+
onSuccess: data => {
13+
queryClient.setQueryData(['todo', { id: 5 }], data)
14+
}
1315
})
1416

1517
mutation.mutate({

0 commit comments

Comments
 (0)