mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
* Ensure hybrid AMP works correctly with SSG * Strip AMP from query when not needed
23 lines
375 B
JavaScript
23 lines
375 B
JavaScript
import { useAmp } from 'next/amp'
|
|
|
|
export const config = {
|
|
amp: true,
|
|
}
|
|
|
|
export const getStaticProps = () => {
|
|
return {
|
|
props: {
|
|
hello: 'hello',
|
|
random: Math.random(),
|
|
},
|
|
}
|
|
}
|
|
|
|
export default ({ hello, random }) => (
|
|
<>
|
|
<p id="use-amp">useAmp: {useAmp() ? 'yes' : 'no'}</p>
|
|
<p id="hello">{hello}</p>
|
|
<p id="random">{random}</p>
|
|
</>
|
|
)
|