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

Function Component

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

Source from the content-addressed store, hash-verified

457 }
458
459 function Component({ value }: { value: string }) {
460 const state = useQuery({
461 queryKey: key,
462 queryFn: () => sleep(10).then(() => `data: ${value}`),
463
464 gcTime: 0,
465 notifyOnChangeProps: 'all',
466 })
467 states.push(state)
468 return (
469 <div>
470 <div>{state.data}</div>
471 </div>
472 )
473 }
474
475 const rendered = renderWithClient(queryClient, <Page />)
476

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useQueryFunction · 0.50

Tested by

no test coverage detected