react-code-dataset / next.js /test /development /app-dir /server-components-hmr-cache /components /shared-page.tsx
Download next.js/test/development/app-dir/server-components-hmr-cache/components/shared-page.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 684 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/server-components-hmr-cache/components/shared-page.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/app-dir/server-components-hmr-cache/components/shared-page.tsx
-
curl -L -o shared-page.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/server-components-hmr-cache/components/shared-page.tsx
684 Bytes
| import Link from 'next/link' | |
| import { after } from 'next/server' | |
| import React from 'react' | |
| import { fetchRandomValue } from '../lib/fetch-random-value' | |
| import { RefreshButton } from './refresh-button' | |
| export async function SharedPage({ runtime }: { runtime: string }) { | |
| const value = await fetchRandomValue(`render-${runtime}`) | |
| after(async () => { | |
| const value = await fetchRandomValue(`after-${runtime}`) | |
| console.log('After:', value) | |
| }) | |
| return ( | |
| <> | |
| <h1>{runtime}</h1> | |
| <p id="content">foo</p> | |
| <p id="value">{value}</p> | |
| <p> | |
| <Link href="/">back to root</Link> | |
| </p> | |
| <p> | |
| <RefreshButton /> | |
| </p> | |
| </> | |
| ) | |
| } | |