snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
20
examples/react/nextjs-app-prefetching/app/page.tsx
Normal file
20
examples/react/nextjs-app-prefetching/app/page.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import React from 'react'
|
||||
import { HydrationBoundary, dehydrate, noop } from '@tanstack/react-query'
|
||||
import { pokemonOptions } from '@/app/pokemon'
|
||||
import { getQueryClient } from '@/app/get-query-client'
|
||||
import { PokemonInfo } from './pokemon-info'
|
||||
|
||||
export default function Home() {
|
||||
const queryClient = getQueryClient()
|
||||
|
||||
void queryClient.query(pokemonOptions).catch(noop)
|
||||
|
||||
return (
|
||||
<main>
|
||||
<h1>Pokemon Info</h1>
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
<PokemonInfo />
|
||||
</HydrationBoundary>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user