Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update with-prefetching example #4850

Merged
merged 1 commit into from Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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>