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

Function List

packages/react-query/src/__tests__/useInfiniteQuery.test.tsx:1129–1145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1127 const initialData = { pages: [1, 2, 3, 4], pageParams: [0, 1, 2, 3] }
1128
1129 function List() {
1130 useInfiniteQuery({
1131 queryKey: key,
1132 queryFn: ({ pageParam }) =>
1133 sleep(50).then(() => {
1134 fetches++
1135 return pageParam * 10
1136 }),
1137 initialData,
1138 initialPageParam: 0,
1139 getNextPageParam: (_, allPages) => {
1140 return allPages.length === 4 ? undefined : allPages.length
1141 },
1142 })
1143
1144 return null
1145 }
1146
1147 function Page() {
1148 const [show, setShow] = React.useState(true)

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useInfiniteQueryFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…