Unverified Commit b7a12655 authored by Marc van Gend's avatar Marc van Gend Committed by GitHub

Document the need to call App.getInitialProps() from a custom app's getInitialProps (#24002)

Document the need to call App.getInitialProps() from a custom app's getInitialProps. See https://github.com/vercel/next.js/issues/23055.
parent 15133b47
......@@ -44,6 +44,7 @@ The `Component` prop is the active `page`, so whenever you navigate between rout
- If your app is running and you just added a custom `App`, you'll need to restart the development server. Only required if `pages/_app.js` didn't exist before.
- Adding a custom `getInitialProps` in your `App` will disable [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md) in pages without [Static Generation](/docs/basic-features/data-fetching.md#getstaticprops-static-generation).
- When you add `getInitialProps` in your custom app, you must `import App from "next/app"`, call `App.getInitialProps(appContext)` inside `getInitialProps` and merge the returned object into the return value.
- `App` currently does not support Next.js [Data Fetching methods](/docs/basic-features/data-fetching.md) like [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation) or [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering).
### TypeScript
......
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