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
88610694
Commit
88610694
authored
Jul 27, 2018
by
Tomek
Committed by
Tim Neutkens
Jul 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update with-prefetching example (#4850)
parent
283e9afe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
32 deletions
+29
-32
_app.js
examples/with-prefetching/pages/_app.js
+25
-0
about.js
examples/with-prefetching/pages/about.js
+1
-8
contact.js
examples/with-prefetching/pages/contact.js
+1
-8
features.js
examples/with-prefetching/pages/features.js
+1
-8
index.js
examples/with-prefetching/pages/index.js
+1
-8
No files found.
examples/with-prefetching/pages/_app.js
0 → 100644
View file @
88610694
import
App
,
{
Container
}
from
'next/app'
import
React
from
'react'
import
Header
from
'../components/Header'
export
default
class
MyApp
extends
App
{
static
async
getInitialProps
({
Component
,
router
,
ctx
})
{
let
pageProps
=
{}
if
(
Component
.
getInitialProps
)
{
pageProps
=
await
Component
.
getInitialProps
(
ctx
)
}
return
{
pageProps
}
}
render
()
{
const
{
Component
,
pageProps
}
=
this
.
props
return
(
<
Container
>
<
Header
/>
<
Component
{...
pageProps
}
/
>
<
/Container
>
)
}
}
examples/with-prefetching/pages/about.js
View file @
88610694
import
Header
from
'../components/Header'
export
default
()
=>
<
p
>
This
is
the
ABOUT
page
.
<
/p
>
export
default
()
=>
(
<
div
>
<
Header
/>
<
p
>
This
is
the
ABOUT
page
.
<
/p
>
<
/div
>
)
examples/with-prefetching/pages/contact.js
View file @
88610694
import
Header
from
'../components/Header'
export
default
()
=>
<
p
>
This
is
the
CONTACT
page
.
<
/p
>
export
default
()
=>
(
<
div
>
<
Header
/>
<
p
>
This
is
the
CONTACT
page
.
<
/p
>
<
/div
>
)
examples/with-prefetching/pages/features.js
View file @
88610694
import
Header
from
'../components/Header'
export
default
()
=>
<
p
>
This
is
the
FEATURES
page
.
<
/p
>
export
default
()
=>
(
<
div
>
<
Header
/>
<
p
>
This
is
the
FEATURES
page
.
<
/p
>
<
/div
>
)
examples/with-prefetching/pages/index.js
View file @
88610694
import
Header
from
'../components/Header'
export
default
()
=>
<
p
>
This
is
the
HOME
page
<
/p
>
export
default
()
=>
(
<
div
>
<
Header
/>
<
p
>
This
is
the
HOME
page
<
/p
>
<
/div
>
)
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