Hi, I’m in the React: Intermediate class.
I got the below error message when I used useMuation(). Anyone knows how to fix it?
No overload matches this call.
The last overload gave the following error.
Argument of type ‘{ mutationFn: (data: Todo) => Promise; onMutate: (newTodo: Todo) => { previousTodos: Todo | undefined; }; onSuccess: (savedTodo: Todo, newTodo: Todo) => void; onError: (error: Error, newTodo: Todo, context: AddTodoContext) => void; }’ is not assignable to parameter of type ‘MutationKey’.
Object literal may only specify known properties, and ‘mutationFn’ does not exist in type ‘readonly unknown’.ts(2769)