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

Function Component

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useQueryFunction · 0.50

Tested by

no test coverage detected