Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions packages/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1421,15 +1421,20 @@ import React from 'react'
import App, { Container } from 'next/app'

class MyApp extends App {
static async getInitialProps({ Component, ctx }) {
let pageProps = {}

if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx)
}

return { pageProps }
}
// Only uncomment this method if you have blocking data requirements for
// every single page in your application. This disables the ability to
// perform automatic static optimization, causing every page in your app to
// be server-side rendered.
//
// static async getInitialProps({ Component, ctx }) {
// let pageProps = {}
//
// if (Component.getInitialProps) {
// pageProps = await Component.getInitialProps(ctx)
// }
//
// return { pageProps }
// }

render() {
const { Component, pageProps } = this.props
Expand Down