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

Function Page

packages/react-query/src/__tests__/useMutation.test.tsx:34–48  ·  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 {
36 mutate,
37 data = 'empty',
38 reset,
39 } = useMutation({ mutationFn: () => Promise.resolve('mutation') })
40
41 return (
42 <div>
43 <h1>{data}</h1>
44 <button onClick={() => reset()}>reset</button>
45 <button onClick={() => mutate()}>mutate</button>
46 </div>
47 )
48 }
49
50 const { getByRole } = renderWithClient(queryClient, <Page />)
51

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…