Open History to see the last commit
1import React from 'react'
2import { HydrationBoundary, dehydrate } from '@tanstack/react-query'
3import { pokemonOptions } from '@/app/pokemon'
4import { getQueryClient } from '@/app/get-query-client'
5import { PokemonInfo } from './pokemon-info'
6β
7export default function Home() {
8 const queryClient = getQueryClient()
9β
10 void queryClient.prefetchQuery(pokemonOptions)
11β
12 return (
13 <main>
14 <h1>Pokemon Info</h1>
15 <HydrationBoundary state={dehydrate(queryClient)}>
16 <PokemonInfo />
17 </HydrationBoundary>
18 </main>
19 )
20}