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

Function prefetch

packages/react-query/src/__tests__/useQuery.test.tsx:3726–3732  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3724
3725 React.useEffect(() => {
3726 async function prefetch() {
3727 await queryClient.prefetchQuery({
3728 queryKey: key,
3729 queryFn: () => Promise.resolve('prefetched data'),
3730 })
3731 act(() => setPrefetched(true))
3732 }
3733
3734 prefetch()
3735 }, [])

Callers 1

PageFunction · 0.70

Calls 1

prefetchQueryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…