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

Function Component

packages/preact-query/src/__tests__/useQuery.test.tsx:469–483  ·  view source on GitHub ↗
({ value }: { value: string })

Source from the content-addressed store, hash-verified

467 }
468
469 function Component({ value }: { value: string }) {
470 const state = useQuery({
471 queryKey: key,
472 queryFn: () => sleep(10).then(() => `data: ${value}`),
473
474 gcTime: 0,
475 notifyOnChangeProps: 'all',
476 })
477 states.push(state)
478 return (
479 <div>
480 <div>{state.data}</div>
481 </div>
482 )
483 }
484
485 const rendered = renderWithClient(queryClient, <Page />)
486

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useQueryFunction · 0.50

Tested by

no test coverage detected