1
0
Fork 0
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:
Dan Zajdband 2017-01-16 18:27:55 -03:00 committed by Tim Neutkens
parent a66ff658f4
commit e28f80cd99
12 changed files with 16 additions and 16 deletions

View file

@ -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

View file

@ -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>
)
}

View file

@ -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>
)
}

View file

@ -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>
)

View file

@ -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>

View file

@ -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>
)

View file

@ -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>
)

View file

@ -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>
)

View file

@ -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>
)

View file

@ -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>
)

View file

@ -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>
)

View file

@ -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}