Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
6ede206d
Commit
6ede206d
authored
Feb 25, 2017
by
Sébastien Dubois
Committed by
Tim Neutkens
Feb 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update link prefetch syntax in examples (#1276)
parent
e24db68f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
15 deletions
+9
-15
index.js
examples/data-fetch/pages/index.js
+2
-2
preact.js
examples/data-fetch/pages/preact.js
+2
-2
index.js
examples/using-inferno/pages/index.js
+2
-2
Header.js
examples/with-apollo/components/Header.js
+3
-3
next.js.flow
examples/with-flow/types/next.js.flow
+0
-6
No files found.
examples/data-fetch/pages/index.js
View file @
6ede206d
import
React
from
'react'
import
React
from
'react'
import
Link
from
'next/
prefetch
'
import
Link
from
'next/
link
'
import
'isomorphic-fetch'
import
'isomorphic-fetch'
export
default
class
MyPage
extends
React
.
Component
{
export
default
class
MyPage
extends
React
.
Component
{
...
@@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
...
@@ -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'
><
a
>
How
about
preact
?
<
/a></
Link
>
<
Link
prefetch
href
=
'/preact'
><
a
>
How
about
preact
?
<
/a></
Link
>
<
/div
>
<
/div
>
)
)
}
}
...
...
examples/data-fetch/pages/preact.js
View file @
6ede206d
import
React
from
'react'
import
React
from
'react'
import
Link
from
'next/
prefetch
'
import
Link
from
'next/
link
'
import
'isomorphic-fetch'
import
'isomorphic-fetch'
export
default
class
MyPage
extends
React
.
Component
{
export
default
class
MyPage
extends
React
.
Component
{
...
@@ -15,7 +15,7 @@ export default class MyPage extends React.Component {
...
@@ -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
=
'/'
><
a
>
I
bet
next
has
more
stars
(?)
<
/a></
Link
>
<
Link
prefetch
href
=
'/'
><
a
>
I
bet
next
has
more
stars
(?)
<
/a></
Link
>
<
/div
>
<
/div
>
)
)
}
}
...
...
examples/using-inferno/pages/index.js
View file @
6ede206d
import
React
from
'react'
import
React
from
'react'
import
Link
from
'next/
prefetch
'
import
Link
from
'next/
link
'
export
default
()
=>
(
export
default
()
=>
(
<
div
>
Hello
World
.
<
Link
href
=
'/about'
><
a
>
About
<
/a></
Link
><
/div
>
<
div
>
Hello
World
.
<
Link
prefetch
href
=
'/about'
><
a
>
About
<
/a></
Link
><
/div
>
)
)
examples/with-apollo/components/Header.js
View file @
6ede206d
import
Link
from
'next/
prefetch
'
import
Link
from
'next/
link
'
export
default
({
pathname
})
=>
(
export
default
({
pathname
})
=>
(
<
header
>
<
header
>
<
Link
href
=
'/'
>
<
Link
prefetch
href
=
'/'
>
<
a
className
=
{
pathname
===
'/'
&&
'is-active'
}
>
Home
<
/a
>
<
a
className
=
{
pathname
===
'/'
&&
'is-active'
}
>
Home
<
/a
>
<
/Link
>
<
/Link
>
<
Link
href
=
'/about'
>
<
Link
prefetch
href
=
'/about'
>
<
a
className
=
{
pathname
===
'/about'
&&
'is-active'
}
>
About
<
/a
>
<
a
className
=
{
pathname
===
'/about'
&&
'is-active'
}
>
About
<
/a
>
<
/Link
>
<
/Link
>
...
...
examples/with-flow/types/next.js.flow
View file @
6ede206d
...
@@ -24,12 +24,6 @@ declare module "next/error" {
...
@@ -24,12 +24,6 @@ declare module "next/error" {
declare module.exports: Class<React$Component<void, {statusCode: number}, any>>;
declare module.exports: Class<React$Component<void, {statusCode: number}, any>>;
}
}
declare module "next/prefetch" {
declare export var prefetch: (url: string) => any;
declare export var reloadIfPrefetched: any;
declare export default Class<React$Component<void, {href: string, prefetch?: boolean}, any>>;
}
declare module "next/router" {
declare module "next/router" {
declare module.exports: {
declare module.exports: {
route: string;
route: string;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment