MCPcopy Index your code
hub / github.com/TanStack/query / Home

Function Home

integrations/react-next-15/app/page.tsx:9–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import { queryExampleAction } from './_action'
8
9export default function Home() {
10 const queryClient = makeQueryClient()
11
12 queryClient.prefetchQuery({
13 queryKey: ['data'],
14 queryFn: async () => {
15 const { count } = await (
16 await fetch('http://localhost:3000/count', {
17 headers: await headers(),
18 })
19 ).json()
20
21 return {
22 text: 'data from server',
23 date: Temporal.PlainDate.from('2024-01-01'),
24 count,
25 }
26 },
27 })
28
29 const state = dehydrate(queryClient)
30
31 return (
32 <main>
33 <HydrationBoundary state={state}>
34 <ClientComponent />
35 </HydrationBoundary>
36 <form action={queryExampleAction}>
37 <button type="submit">Increment</button>
38 </form>
39 </main>
40 )
41}

Callers

nothing calls this directly

Calls 3

makeQueryClientFunction · 0.90
dehydrateFunction · 0.85
prefetchQueryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…