rsnext/examples/with-webpack-bundle-size-analyzer/pages/index.js
David Janda 44b7b3c953
Updated with-webpack-bundle-size-analyzer to use SSG (#11657)
* Replaced getInitialProps with SSG

* Moved faker to a top level import and re-added contact.js
2020-04-07 13:20:50 -05:00

31 lines
570 B
JavaScript

import Link from 'next/link'
import faker from 'faker'
const Index = ({ name }) => {
return (
<div>
<h1>Home Page</h1>
<p>Welcome, {name}.</p>
<p>
This page is using getServerSideProps, so the name will be different
every time the page is rendered.
</p>
<div>
<Link href="/about">
<a>About Page</a>
</Link>
</div>
</div>
)
}
export async function getServerSideProps() {
const name = faker.name.findName()
return {
props: {
name,
},
}
}
export default Index