react-code-dataset / next.js /test /development /app-dir /cache-components-dev-cache-scope /app /uncached /page.tsx
Download next.js/test/development/app-dir/cache-components-dev-cache-scope/app/uncached/page.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/cache-components-dev-cache-scope/app/uncached/page.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/app-dir/cache-components-dev-cache-scope/app/uncached/page.tsx
-
curl -L -o page.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/cache-components-dev-cache-scope/app/uncached/page.tsx
666 Bytes
| import { fetchData } from '../api/data' | |
| // import { Suspense } from 'react' | |
| // import { cookies, headers } from 'next/headers' | |
| function InnerComponent({ children }) { | |
| return <span id="value">{children}</span> | |
| } | |
| async function refresh() { | |
| 'use server' | |
| } | |
| async function reload() { | |
| 'use server' | |
| } | |
| async function Component() { | |
| return <InnerComponent>{await fetchData()}</InnerComponent> | |
| } | |
| export default async function Home() { | |
| return ( | |
| <> | |
| <form action={refresh}> | |
| <button id="refresh">Refresh</button> | |
| </form> | |
| <form action={reload}> | |
| <button id="reload">Reload</button> | |
| </form> | |
| <Component /> | |
| </> | |
| ) | |
| } | |