Skip to content

Commit e28f80c

Browse files
impronunciabletimneutkens
authored andcommitted
Updated <Link> in repo, always wrapping an anchor. (#798)
1 parent a66ff65 commit e28f80c

File tree

12 files changed

+16
-16
lines changed

12 files changed

+16
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export default () => (
327327
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:
328328

329329
```jsx
330-
<Link href='/contact' prefetch={false}>Home</Link>
330+
<Link href='/contact' prefetch={false}><a>Home</a></Link>
331331
```
332332

333333
#### Imperatively

examples/data-fetch/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
1515
return (
1616
<div>
1717
<p>Next.js has {this.props.stars} ⭐️</p>
18-
<Link href='/preact'>How about preact?</Link>
18+
<Link href='/preact'><a>How about preact?</a></Link>
1919
</div>
2020
)
2121
}

examples/data-fetch/pages/preact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
1515
return (
1616
<div>
1717
<p>Preact has {this.props.stars} ⭐️</p>
18-
<Link href='/'>I bet next has more stars (?)</Link>
18+
<Link href='/'><a>I bet next has more stars (?)</a></Link>
1919
</div>
2020
)
2121
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import Link from 'next/link'
22
export default () => (
3-
<div>Hello World. <Link href='/about'>About</Link></div>
3+
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
44
)

examples/layout-component/components/layout.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export default ({ children, title = 'This is the default title' }) => (
1010
</Head>
1111
<header>
1212
<nav>
13-
<Link href='/'>Home</Link> |
14-
<Link href='/about'>About</Link> |
15-
<Link href='/contact'>Contact</Link>
13+
<Link href='/'><a>Home</a></Link> |
14+
<Link href='/about'><a>About</a></Link> |
15+
<Link href='/contact'><a>Contact</a></Link>
1616
</nav>
1717
</header>
1818

examples/using-inferno/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import React from 'react'
22
import Link from 'next/prefetch'
33

44
export default () => (
5-
<div>Hello World. <Link href='/about'>About</Link></div>
5+
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
66
)

examples/using-preact/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import React from 'react'
22
import Link from 'next/link'
33

44
export default () => (
5-
<div>Hello World. <Link href='/about'>About</Link></div>
5+
<div>Hello World. <Link href='/about'><a>About</a></Link></div>
66
)

examples/using-router/components/Header.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import Router from 'next/router'
22

33
export default () => (
44
<div>
5-
<Link href='/'>Home</Link>
6-
<Link href='/about'>About</Link>
7-
<Link href='/error'>Error</Link>
5+
<Link href='/'><a>Home</a></Link>
6+
<Link href='/about'><a>About</a></Link>
7+
<Link href='/error'><a>Error</a></Link>
88
</div>
99
)
1010

examples/with-mobx/components/Page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Page extends React.Component {
2020
<h1>{this.props.title}</h1>
2121
<Clock lastUpdate={this.props.store.lastUpdate} light={this.props.store.light} />
2222
<nav>
23-
<Link href={this.props.linkTo}>Navigate</Link>
23+
<Link href={this.props.linkTo}><a>Navigate</a></Link>
2424
</nav>
2525
</div>
2626
)

examples/with-redux/components/Page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default connect(state => state)(({ title, linkTo, lastUpdate, light }) =>
88
<h1>{title}</h1>
99
<Clock lastUpdate={lastUpdate} light={light} />
1010
<nav>
11-
<Link href={linkTo}>Navigate</Link>
11+
<Link href={linkTo}><a>Navigate</a></Link>
1212
</nav>
1313
</div>
1414
)

0 commit comments

Comments
 (0)