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

Function Component

packages/solid-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 gcTime: 0,
495 }))
496 createRenderEffect(() => {
497 states.push({ ...state })
498 })
499 return (
500 <div>
501 <div>{state.data}</div>
502 </div>
503 )
504 }
505
506 const rendered = renderWithClient(queryClient, () => <Page />)
507

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useQueryFunction · 0.50

Tested by

no test coverage detected