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

Function Page

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 14

sleepFunction · 0.90
setActTimeoutFunction · 0.90
refetchFunction · 0.85
refetchMethod · 0.80
useUserInfoQueryFunction · 0.70
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