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

Function FirstComponent

packages/solid-query/src/__tests__/useQuery.test.tsx:1416–1432  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1414 const states: Array<UseQueryResult<number>> = []
1415
1416 function FirstComponent() {
1417 const state = useQuery(() => ({
1418 queryKey: key,
1419 queryFn: () => sleep(10).then(() => 1),
1420 }))
1421
1422 createRenderEffect(() => {
1423 states.push({ ...state })
1424 })
1425
1426 return (
1427 <div>
1428 <button onClick={() => state.refetch()}>refetch</button>
1429 data: {state.data}
1430 </div>
1431 )
1432 }
1433
1434 function SecondComponent() {
1435 useQuery(() => ({

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
refetchMethod · 0.80
useQueryFunction · 0.50

Tested by

no test coverage detected