Download next.js/packages/next/src/shared/lib/amp.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 289 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/amp.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/shared/lib/amp.ts
-
curl -L -o amp.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/amp.ts
289 Bytes
| import React from 'react' | |
| import { AmpStateContext } from './amp-context.shared-runtime' | |
| import { isInAmpMode } from './amp-mode' | |
| export function useAmp(): boolean { | |
| // Don't assign the context value to a variable to save bytes | |
| return isInAmpMode(React.useContext(AmpStateContext)) | |
| } | |