Skip to content

Commit 2e8f38c

Browse files
authored
docs: Add curly brackets to mutation example for TS (TanStack#2193)
1 parent 3a13b3e commit 2e8f38c

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)