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

Function Component

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

Source from the content-addressed store, hash-verified

488 }
489
490 function Component({ value }: { value: string }) {
491 const state = useQuery({
492 queryKey: key,
493 queryFn: () => sleep(10).then(() => 'data: ' + value),
494
495 gcTime: 0,
496 notifyOnChangeProps: 'all',
497 })
498 states.push(state)
499 return (
500 <div>
501 <div>{state.data}</div>
502 </div>
503 )
504 }
505
506 const rendered = renderWithClient(queryClient, <Page />)
507

Callers 15

PageClass · 0.50
HostClass · 0.50
ExampleClass · 0.50
FakeComponentClass · 0.50
TestComponentClass · 0.50
PageClass · 0.50
FakeComponentClass · 0.50
PageClass · 0.50
TestComponentClass · 0.50
TestComponentClass · 0.50

Calls 2

sleepFunction · 0.90
useQueryFunction · 0.50

Tested by

no test coverage detected