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

Function Page

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

Source from the content-addressed store, hash-verified

39 let renders = 0
40
41 function Page() {
42 renders++
43
44 const [stateKey, setStateKey] = React.useState(key)
45
46 const state = useSuspenseQuery({
47 queryKey: stateKey,
48 queryFn: () => sleep(10).then(() => ++count),
49 })
50
51 states.push(state)
52
53 return (
54 <div>
55 <button aria-label="toggle" onClick={() => setStateKey(queryKey())} />
56 data: {String(state.data)}
57 </div>
58 )
59 }
60
61 const rendered = renderWithClient(
62 queryClient,

Callers

nothing calls this directly

Calls 6

sleepFunction · 0.90
queryKeyFunction · 0.90
useSuspenseQueryFunction · 0.85
useSuspenseInfiniteQueryFunction · 0.85
refetchMethod · 0.80
resetQueriesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…