MCPcopy Create free account
hub / github.com/TanStack/query / Page

Function Page

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected