Repository navigation
TVariables default Type #8752
Unanswered
hossein-jorfi
asked this question in
Q&A
Replies: 1 comment
|
You don’t need to specify the type Variables = {
title: string;
};
const { mutate } = useMutation({
mutationFn: async (values: Variables) => {
const response = await axios.post('/test', values);
return response.data;
},
});
mutate({ title: 'Hello' });Here, The practical benefit of the For your example, typing |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Shouldn't TVariables default be "any" or "unknown" so you dont have to define it unless its important to you to be defined
Originally posted by @TkDodo in #2134
All reactions