snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
10
examples/react/nextjs-app-prefetching/app/pokemon.ts
Normal file
10
examples/react/nextjs-app-prefetching/app/pokemon.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { queryOptions } from '@tanstack/react-query'
|
||||
|
||||
export const pokemonOptions = queryOptions({
|
||||
queryKey: ['pokemon'],
|
||||
queryFn: async () => {
|
||||
const response = await fetch('https://pokeapi.co/api/v2/pokemon/25')
|
||||
|
||||
return response.json()
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user