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

Function Component

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

Source from the content-addressed store, hash-verified

350 let count = 0
351
352 function Component() {
353 const result = useSuspenseQuery({
354 queryKey: key,
355 queryFn: () => sleep(10).then(() => ++count),
356 staleTime: () => 60 * 1000,
357 })
358 return (
359 <div>
360 <span>data: {result.data}</span>
361 </div>
362 )
363 }
364
365 function Page() {
366 return (

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useSuspenseQueryFunction · 0.50

Tested by

no test coverage detected