T
TanStack3y ago
adverse-sapphire

typeof useMutation

hello! I have a const mutator = useMutation({onSuccess,...}) i pass the mutator to child components .... what is the type of this object? Thank you!
3 Replies
adverse-sapphire
adverse-sapphireOP3y ago
(and where would i find documentation about that kind of thing in the future?)
extended-salmon
extended-salmon3y ago
I don't know by heart, what does type inference say?
plain-purple
plain-purple3y ago
Should be UseMutationResult<TData, TError, TVariables, TContext> . If you're using an editor like vscode, one thing I usually do is hit "go to definition..." on useQuery or useMutation to see the types.

Did you find this page helpful?