MCPcopy
hub / github.com/TanStack/query / Mutate

Function Mutate

packages/react-query/src/__tests__/useMutationState.test.tsx:205–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203 }
204
205 function Mutate() {
206 const { mutate, data } = useMutation({
207 mutationKey,
208 mutationFn: (input: number) => sleep(150).then(() => 'data' + input),
209 })
210
211 return (
212 <div>
213 data: {data ?? 'null'}
214 <button onClick={() => mutate(1)}>mutate</button>
215 </div>
216 )
217 }
218
219 function Page() {
220 return (

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
useMutationFunction · 0.50
mutateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…