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

Function Component

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

Source from the content-addressed store, hash-verified

472 }
473
474 function Component(props: { value: string }) {
475 const state = useQuery(() => ({
476 queryKey: key,
477 queryFn: () => sleep(10).then(() => 'data: ' + props.value),
478 gcTime: 0,
479 }))
480 createRenderEffect(() => {
481 states.push({ ...state })
482 })
483 return (
484 <div>
485 <div>{state.data}</div>
486 </div>
487 )
488 }
489
490 const rendered = renderWithClient(queryClient, () => <Page />)
491

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useQueryFunction · 0.50

Tested by

no test coverage detected