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

Function Page

packages/solid-query/src/__tests__/useMutation.test.tsx:34–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33 it('should be able to reset `data`', async () => {
34 function Page() {
35 const mutation = useMutation(() => ({
36 mutationFn: () => Promise.resolve('mutation'),
37 }))
38
39 return (
40 <div>
41 <h1>{mutation.data ?? 'empty'}</h1>
42 <button onClick={() => mutation.reset()}>reset</button>
43 <button onClick={() => mutation.mutate()}>mutate</button>
44 </div>
45 )
46 }
47
48 const rendered = render(() => (
49 <QueryClientProvider client={queryClient}>

Callers

nothing calls this directly

Calls 6

setActTimeoutFunction · 0.90
sleepFunction · 0.90
useMutationFunction · 0.50
mutateFunction · 0.50
resetMethod · 0.45
mutateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…