mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Updated <Link> in repo, always wrapping an anchor. (#798)
This commit is contained in:
parent
a66ff658f4
commit
e28f80cd99
|
@ -327,7 +327,7 @@ export default () => (
|
|||
When this higher-level `<Link>` component is first used, the `ServiceWorker` gets installed. To turn off prefetching on a per-`<Link>` basis, you can use the `prefetch` attribute:
|
||||
|
||||
```jsx
|
||||
<Link href='/contact' prefetch={false}>Home</Link>
|
||||
<Link href='/contact' prefetch={false}><a>Home</a></Link>
|
||||
```
|
||||
|
||||
#### Imperatively
|
||||
|
|
|
@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
|
|||
return (
|
||||
<div>
|
||||
<p>Next.js has {this.props.stars} ⭐️</p>
|
||||
<Link href='/preact'>How about preact?</Link>
|
||||
<Link href='/preact'><a>How about preact?</a></Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
|
|||
return (
|
||||
<div>
|
||||
<p>Preact has {this.props.stars} ⭐️</p>
|
||||
<Link href='/'>I bet next has more stars (?)</Link>
|
||||
<Link href='/'><a>I bet next has more stars (?)</a></Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Link from 'next/link'
|
||||
export default () => (
|
||||
<div>Hello World. <Link href='/about'>About</Link></div>
|
||||
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
|
||||
)
|
||||
|
|
|
@ -10,9 +10,9 @@ export default ({ children, title = 'This is the default title' }) => (
|
|||
</Head>
|
||||
<header>
|
||||
<nav>
|
||||
<Link href='/'>Home</Link> |
|
||||
<Link href='/about'>About</Link> |
|
||||
<Link href='/contact'>Contact</Link>
|
||||
<Link href='/'><a>Home</a></Link> |
|
||||
<Link href='/about'><a>About</a></Link> |
|
||||
<Link href='/contact'><a>Contact</a></Link>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
|
|
@ -2,5 +2,5 @@ import React from 'react'
|
|||
import Link from 'next/prefetch'
|
||||
|
||||
export default () => (
|
||||
<div>Hello World. <Link href='/about'>About</Link></div>
|
||||
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
|
||||
)
|
||||
|
|
|
@ -2,5 +2,5 @@ import React from 'react'
|
|||
import Link from 'next/link'
|
||||
|
||||
export default () => (
|
||||
<div>Hello World. <Link href='/about'>About</Link></div>
|
||||
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
|
||||
)
|
||||
|
|
|
@ -2,9 +2,9 @@ import Router from 'next/router'
|
|||
|
||||
export default () => (
|
||||
<div>
|
||||
<Link href='/'>Home</Link>
|
||||
<Link href='/about'>About</Link>
|
||||
<Link href='/error'>Error</Link>
|
||||
<Link href='/'><a>Home</a></Link>
|
||||
<Link href='/about'><a>About</a></Link>
|
||||
<Link href='/error'><a>Error</a></Link>
|
||||
</div>
|
||||
)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class Page extends React.Component {
|
|||
<h1>{this.props.title}</h1>
|
||||
<Clock lastUpdate={this.props.store.lastUpdate} light={this.props.store.light} />
|
||||
<nav>
|
||||
<Link href={this.props.linkTo}>Navigate</Link>
|
||||
<Link href={this.props.linkTo}><a>Navigate</a></Link>
|
||||
</nav>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -8,7 +8,7 @@ export default connect(state => state)(({ title, linkTo, lastUpdate, light }) =>
|
|||
<h1>{title}</h1>
|
||||
<Clock lastUpdate={lastUpdate} light={light} />
|
||||
<nav>
|
||||
<Link href={linkTo}>Navigate</Link>
|
||||
<Link href={linkTo}><a>Navigate</a></Link>
|
||||
</nav>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react'
|
||||
import Link from 'next/link'
|
||||
export default () => (
|
||||
<div>Hello World. <Link href='/about'>About</Link></div>
|
||||
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
|
||||
)
|
||||
|
|
|
@ -13,7 +13,7 @@ export default class extends Component {
|
|||
render () {
|
||||
return (
|
||||
<div className='nav-home'>
|
||||
<Link href='/nav/about'>About</Link>
|
||||
<Link href='/nav/about'><a>About</a></Link>
|
||||
<p>This is the home.</p>
|
||||
<div id='counter'>
|
||||
Counter: {counter}
|
||||
|
|
Loading…
Reference in a new issue