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:
|
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
|
```jsx
|
||||||
<Link href='/contact' prefetch={false}>Home</Link>
|
<Link href='/contact' prefetch={false}><a>Home</a></Link>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Imperatively
|
#### Imperatively
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<p>Next.js has {this.props.stars} ⭐️</p>
|
<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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<p>Preact has {this.props.stars} ⭐️</p>
|
<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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
export default () => (
|
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>
|
</Head>
|
||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<Link href='/'>Home</Link> |
|
<Link href='/'><a>Home</a></Link> |
|
||||||
<Link href='/about'>About</Link> |
|
<Link href='/about'><a>About</a></Link> |
|
||||||
<Link href='/contact'>Contact</Link>
|
<Link href='/contact'><a>Contact</a></Link>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@ import React from 'react'
|
||||||
import Link from 'next/prefetch'
|
import Link from 'next/prefetch'
|
||||||
|
|
||||||
export default () => (
|
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'
|
import Link from 'next/link'
|
||||||
|
|
||||||
export default () => (
|
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 () => (
|
export default () => (
|
||||||
<div>
|
<div>
|
||||||
<Link href='/'>Home</Link>
|
<Link href='/'><a>Home</a></Link>
|
||||||
<Link href='/about'>About</Link>
|
<Link href='/about'><a>About</a></Link>
|
||||||
<Link href='/error'>Error</Link>
|
<Link href='/error'><a>Error</a></Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Page extends React.Component {
|
||||||
<h1>{this.props.title}</h1>
|
<h1>{this.props.title}</h1>
|
||||||
<Clock lastUpdate={this.props.store.lastUpdate} light={this.props.store.light} />
|
<Clock lastUpdate={this.props.store.lastUpdate} light={this.props.store.light} />
|
||||||
<nav>
|
<nav>
|
||||||
<Link href={this.props.linkTo}>Navigate</Link>
|
<Link href={this.props.linkTo}><a>Navigate</a></Link>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default connect(state => state)(({ title, linkTo, lastUpdate, light }) =>
|
||||||
<h1>{title}</h1>
|
<h1>{title}</h1>
|
||||||
<Clock lastUpdate={lastUpdate} light={light} />
|
<Clock lastUpdate={lastUpdate} light={light} />
|
||||||
<nav>
|
<nav>
|
||||||
<Link href={linkTo}>Navigate</Link>
|
<Link href={linkTo}><a>Navigate</a></Link>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
export default () => (
|
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 () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div className='nav-home'>
|
<div className='nav-home'>
|
||||||
<Link href='/nav/about'>About</Link>
|
<Link href='/nav/about'><a>About</a></Link>
|
||||||
<p>This is the home.</p>
|
<p>This is the home.</p>
|
||||||
<div id='counter'>
|
<div id='counter'>
|
||||||
Counter: {counter}
|
Counter: {counter}
|
||||||
|
|
Loading…
Reference in a new issue