rsnext/packages/next/shared/lib/amp.ts
Steven ccd3df2f81
Fix bloat in main bundle from amp (#37383)
- Related to #35900 
- Related to #36702 
- Related to #35907
2022-06-02 00:21:09 +00:00

8 lines
274 B
TypeScript

import React from 'react'
import { AmpStateContext } from './amp-context'
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))
}