Download next.js/test/e2e/app-dir/actions/app/delayed-action/layout-node.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 369 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/delayed-action/layout-node.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/actions/app/delayed-action/layout-node.tsx
-
curl -L -o layout-node.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/actions/app/delayed-action/layout-node.tsx
369 Bytes
| 'use client' | |
| import { useState } from 'react' | |
| import { DataContext } from './context' | |
| export default function Layout({ children }) { | |
| const [data, setData] = useState<number | null>(null) | |
| return ( | |
| <DataContext.Provider value={{ data, setData }}> | |
| <div>{children}</div> | |
| <div id="delayed-action-result">{data}</div> | |
| </DataContext.Provider> | |
| ) | |
| } | |