rsnext/test/integration/prerender/pages/blog/[post]/[comment].js
JJ Kasper fc7e235f2c Followup optimizations for new experimentalPrerender (#8287)
* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Update dead code elimination
2019-08-11 21:56:57 -04:00

18 lines
337 B
JavaScript

import Link from 'next/link'
export const config = { experimentalPrerender: true }
const Comment = ({ data }) => (
<>
<p>Comment: {data}</p>
<Link href='/'>
<a id='home'>to home</a>
</Link>
</>
)
Comment.getInitialProps = () => ({
data: typeof window === 'undefined' ? 'SSR' : 'CSR'
})
export default Comment