react-code-dataset / next.js /test /e2e /app-dir /app-basepath-custom-server /custom-server /components /counter.js
Download next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/components/counter.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 305 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/components/counter.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/components/counter.js
-
curl -L -o counter.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-basepath-custom-server/custom-server/components/counter.js
305 Bytes
| 'use client' | |
| import { useState } from 'react' | |
| export function Counter() { | |
| const [count, setCount] = useState(0) | |
| return ( | |
| <div> | |
| <p id="current-count">Count: {count}</p> | |
| <button onClick={() => setCount(count + 1)} id="increase-count"> | |
| Increment | |
| </button> | |
| </div> | |
| ) | |
| } | |