Download next.js/test/e2e/app-dir/app-prefetch/app/with-error/page.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 348 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-prefetch/app/with-error/page.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-prefetch/app/with-error/page.tsx
-
curl -L -o page.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-prefetch/app/with-error/page.tsx
348 Bytes
| 'use client' | |
| import { useState } from 'react' | |
| /** Add your relevant code here for the issue to reproduce */ | |
| export default function Page() { | |
| const [error, setError] = useState(false) | |
| if (error) { | |
| throw new Error('This is a test error') | |
| } | |
| return ( | |
| <> | |
| <button onClick={() => setError(true)}>Throw Error</button> | |
| </> | |
| ) | |
| } | |