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

Function Page

packages/react-query/src/__tests__/useQuery.test.tsx:48–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 const key = queryKey()
47
48 function Page() {
49 const { data = 'default' } = useQuery({
50 queryKey: key,
51 queryFn: () => sleep(10).then(() => 'test'),
52 })
53
54 return (
55 <div>
56 <h1>{data}</h1>
57 </div>
58 )
59 }
60
61 const rendered = renderWithClient(queryClient, <Page />)
62

Callers

nothing calls this directly

Calls 14

sleepFunction · 0.90
setActTimeoutFunction · 0.90
refetchFunction · 0.85
useUserInfoQueryFunction · 0.85
refetchMethod · 0.80
prefetchFunction · 0.70
queryFnFunction · 0.70
useQueryFunction · 0.50
removeQueriesMethod · 0.45
refetchQueriesMethod · 0.45
invalidateQueriesMethod · 0.45
setQueryDataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…