MCPcopy
hub / github.com/TanStack/query / FirstComponent

Function FirstComponent

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

Source from the content-addressed store, hash-verified

1615 const states: Array<UseQueryResult<number>> = []
1616
1617 function FirstComponent() {
1618 const state = useQuery(() => ({
1619 queryKey: key,
1620 queryFn: async () => {
1621 await sleep(10)
1622 return 1
1623 },
1624 }))
1625
1626 createRenderEffect(() => {
1627 states.push({ ...state })
1628 })
1629
1630 return (
1631 <div>
1632 <button onClick={() => state.refetch()}>refetch</button>
1633 data: {state.data}
1634 </div>
1635 )
1636 }
1637
1638 function SecondComponent() {
1639 useQuery(() => ({

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
refetchMethod · 0.80
useQueryFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…