1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-data-prefetch/pages/index.js
Sergio Xalambrí ffdf4e3228 Add with-data-prefetch example (#3420)
* Add with-data-prefetch example

* Fix typos

* Improve example code
2017-12-26 21:46:46 +01:00

26 lines
572 B
JavaScript

import Link from '../components/link'
// we just render a list of 3 articles having 2 with prefetched data
export default () => (
<main>
<h1>Next.js - with data prefetch example</h1>
<ul>
<li>
<Link href='/article?id=1' prefetch withData>
<a>Article 1</a>
</Link>
</li>
<li>
<Link href='/article?id=2' prefetch>
<a>Article 2</a>
</Link>
</li>
<li>
<Link href='/article?id=3' prefetch withData>
<a>Article 3</a>
</Link>
</li>
</ul>
</main>
)