Custom hook for mutation not working #5862
-
Beta Was this translation helpful? Give feedback.
Answered by
fredrik-andersson-yoin
Aug 10, 2023
Replies: 1 comment 2 replies
-
I think that if there are multiple arguments to the mutation function they must be supplied as an object.
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
lagroms
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think that if there are multiple arguments to the mutation function they must be supplied as an object.
mutationFn: (variables: TVariables) => Promise<TData>
and
mutate: (variables: TVariables, { onSuccess, onSettled, onError }) => void
from: https://tanstack.com/query/v4/docs/react/reference/useMutation