Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

pokemon-info.tsx

18 lines408 Bytes

1'use client'
2​
3import React from 'react'
4import { useSuspenseQuery } from '@tanstack/react-query'
5import { pokemonOptions } from '@/app/pokemon'
6​
7export function PokemonInfo() {
8 const { data } = useSuspenseQuery(pokemonOptions)
9​
10 return (
11 <div>
12 <figure>
13 <img src={data.sprites.front_shiny} height={200} alt={data.name} />
14 <h2>I'm {data.name}</h2>
15 </figure>
16 </div>
17 )