Download react-query/examples/react/nextjs-app-prefetching/app/page.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-app-prefetching/app/page.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-app-prefetching/app/page.tsx
-
curl -L -o page.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/nextjs-app-prefetching/app/page.tsx
543 Bytes
| import React from 'react' | |
| import { HydrationBoundary, dehydrate } 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.prefetchQuery(pokemonOptions) | |
| return ( | |
| <main> | |
| <h1>Pokemon Info</h1> | |
| <HydrationBoundary state={dehydrate(queryClient)}> | |
| <PokemonInfo /> | |
| </HydrationBoundary> | |
| </main> | |
| ) | |
| } | |