Skip to content

Commit

Permalink
update with-prefetching example (#4850)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomekmularczyk authored and timneutkens committed Jul 27, 2018
1 parent 283e9af commit 8861069
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
25 changes: 25 additions & 0 deletions examples/with-prefetching/pages/_app.js
@@ -0,0 +1,25 @@
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>
)
}
}
9 changes: 1 addition & 8 deletions examples/with-prefetching/pages/about.js
@@ -1,8 +1 @@
import Header from '../components/Header'

export default () => (
<div>
<Header />
<p>This is the ABOUT page.</p>
</div>
)
export default () => <p>This is the ABOUT page.</p>
9 changes: 1 addition & 8 deletions examples/with-prefetching/pages/contact.js
@@ -1,8 +1 @@
import Header from '../components/Header'

export default () => (
<div>
<Header />
<p>This is the CONTACT page.</p>
</div>
)
export default () => <p>This is the CONTACT page.</p>
9 changes: 1 addition & 8 deletions examples/with-prefetching/pages/features.js
@@ -1,8 +1 @@
import Header from '../components/Header'

export default () => (
<div>
<Header />
<p>This is the FEATURES page.</p>
</div>
)
export default () => <p>This is the FEATURES page.</p>
9 changes: 1 addition & 8 deletions examples/with-prefetching/pages/index.js
@@ -1,8 +1 @@
import Header from '../components/Header'

export default () => (
<div>
<Header />
<p>This is the HOME page</p>
</div>
)
export default () => <p>This is the HOME page</p>

0 comments on commit 8861069

Please sign in to comment.