Download next.js/test/e2e/app-dir/actions/app/static/[slug]/button.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 410 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/static/%5Bslug%5D/button.js
- Command line
-
hf download 'hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/actions/app/static/[slug]/button.js'
-
curl -L -o button.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/static/%5Bslug%5D/button.js
410 Bytes
| 'use client' | |
| import { useState } from 'react' | |
| import { inc } from '../../client/actions' | |
| export function Button() { | |
| const [count, setCount] = useState(0) | |
| return ( | |
| <> | |
| <p id="count">{count}</p> | |
| <button | |
| id="inc" | |
| onClick={async () => { | |
| const newCount = await inc(count) | |
| setCount(newCount) | |
| }} | |
| > | |
| click me | |
| </button> | |
| </> | |
| ) | |
| } | |