-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Describe the bug
mutationFn is missing from declaration for UseMutationOptions. Preventing you from specifying mutation function in form of reusable config object similar to UseQueryOptions. Casting options object with mutationFn to any, bypassing type checks, code works fine and mutation function is called.
To Reproduce
In typescript project:
const mutation = useMutation({
mutationFn: ()=>Promise.resolve(console.log('I am mutationFn'))
})and run type checking.
Expected behavior
mutationFn should be an optional key in UseMutationOptions generic.
Desktop (please complete the following information):
- any
Smartphone (please complete the following information):
- any
mduthilleul and biggytech