react-code-dataset / next.js /test /development /pages-dir /client-navigation /fixture /pages /head-dynamic.js
Download next.js/test/development/pages-dir/client-navigation/fixture/pages/head-dynamic.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 439 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/pages/head-dynamic.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/pages-dir/client-navigation/fixture/pages/head-dynamic.js
-
curl -L -o head-dynamic.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/pages-dir/client-navigation/fixture/pages/head-dynamic.js
439 Bytes
| import Head from 'next/head' | |
| import React from 'react' | |
| function Foo() { | |
| const [displayed, toggle] = React.useState(true) | |
| return ( | |
| <> | |
| {displayed ? ( | |
| <Head> | |
| <title>B</title> | |
| </Head> | |
| ) : null} | |
| <button onClick={() => toggle(!displayed)}>toggle</button> | |
| </> | |
| ) | |
| } | |
| export default () => { | |
| return ( | |
| <> | |
| <Head> | |
| <title>A</title> | |
| </Head> | |
| <Foo /> | |
| </> | |
| ) | |
| } | |