Commit 4ab56e8a authored by Borek Bernard's avatar Borek Bernard Committed by Tim Neutkens

Update custom app example in README (#8320)

The code example now uses simpler and safer approach to call page's `getInitialProps`.
parent 2b62c33f
......@@ -1526,14 +1526,11 @@ class MyApp extends App {
// perform automatic static optimization, causing every page in your app to
// be server-side rendered.
//
// static async getInitialProps({ Component, ctx }) {
// let pageProps = {}
// static async getInitialProps(appContext) {
// // calls page's `getInitialProps` and fills `appProps.pageProps`
// const appProps = await App.getInitialProps(appContext);
//
// if (Component.getInitialProps) {
// pageProps = await Component.getInitialProps(ctx)
// }
//
// return { pageProps }
// return { ...appProps }
// }
render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment