Download next.js/test/integration/app-document-style-fragment/pages/_document.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 679 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/integration/app-document-style-fragment/pages/_document.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/integration/app-document-style-fragment/pages/_document.js
-
curl -L -o _document.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/integration/app-document-style-fragment/pages/_document.js
679 Bytes
| import Document, { Html, Head, Main, NextScript } from 'next/document' | |
| class MyDocument extends Document { | |
| static async getInitialProps(ctx) { | |
| const initialProps = await Document.getInitialProps(ctx) | |
| return { | |
| ...initialProps, | |
| styles: ( | |
| <> | |
| {initialProps.styles} | |
| <style | |
| id="sbg" | |
| dangerouslySetInnerHTML={{ | |
| __html: `html { background: hotpink; }`, | |
| }} | |
| /> | |
| </> | |
| ), | |
| } | |
| } | |
| render() { | |
| return ( | |
| <Html> | |
| <Head /> | |
| <body> | |
| <Main /> | |
| <NextScript /> | |
| </body> | |
| </Html> | |
| ) | |
| } | |
| } | |
| export default MyDocument | |