mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
bacb42ead4
* Updated README with new features and code fixes * Removed staticMarkup option from docs. * Fixed quiet parameter info.
31 lines
675 B
JavaScript
31 lines
675 B
JavaScript
import Link, { prefetch } from 'next/prefetch'
|
|
import RegularLink from 'next/link'
|
|
|
|
export default () => (
|
|
<div>
|
|
{ /* Prefetch using the declarative API */ }
|
|
<Link href='/'>
|
|
<a>Home</a>
|
|
</Link>
|
|
|
|
<Link href='/features'>
|
|
<a>Features</a>
|
|
</Link>
|
|
|
|
{ /* we imperatively prefetch on hover */ }
|
|
<RegularLink href='/about'>
|
|
<a onMouseEnter={() => prefetch('/about') && console.log('prefetching /about!')}>About</a>
|
|
</RegularLink>
|
|
|
|
<Link href='/contact' prefetch={false}>
|
|
<a>Contact (<small>NO-PREFETCHING</small>)</a>
|
|
</Link>
|
|
|
|
<style jsx>{`
|
|
a {
|
|
margin-right: 10px;
|
|
}
|
|
`}</style>
|
|
</div>
|
|
)
|