Download next.js/test/e2e/app-dir/app-css/app/client-nested/layout.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 449 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-css/app/client-nested/layout.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-css/app/client-nested/layout.js
-
curl -L -o layout.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-css/app/client-nested/layout.js
449 Bytes
| 'use client' | |
| import { useState, useEffect } from 'react' | |
| import styles from './style.module.css' | |
| import './style.css' | |
| export default function ClientNestedLayout({ children }) { | |
| const [count, setCount] = useState(0) | |
| useEffect(() => { | |
| setCount(1) | |
| }, []) | |
| return ( | |
| <> | |
| <h1 className={styles.red}>Client Nested. Count: {count}</h1> | |
| <button onClick={() => setCount(count + 1)}>{count}</button> | |
| {children} | |
| </> | |
| ) | |
| } | |