From 1690a756e22f8286ecb4ea004706c1d6aed6d102 Mon Sep 17 00:00:00 2001 From: Luis Alvarez D Date: Mon, 23 Mar 2020 18:02:41 -0500 Subject: [PATCH] Update GIP docs (#11303) * Updated docs * bump Co-authored-by: JJ Kasper Co-authored-by: Joe Haddad --- .../data-fetching/getInitialProps.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/api-reference/data-fetching/getInitialProps.md b/docs/api-reference/data-fetching/getInitialProps.md index d08c84b4f039012..6d161d6732c0c3e 100644 --- a/docs/api-reference/data-fetching/getInitialProps.md +++ b/docs/api-reference/data-fetching/getInitialProps.md @@ -4,15 +4,12 @@ description: Enable Server-Side Rendering in a page and do initial data populati # getInitialProps -## Recommended: `getStaticProps` or `getServerSideProps` - -If you're using Next.js 9.3 or newer, we recommend that you use `getStaticProps` or `getServerSideProps` instead of `getInitialProps`. - -These new data fetching methods allow you to have a granular choice between static generation and server-side rendering. - -Learn more on the [Pages documentation](/docs/basic-features/pages.md) and the [Data fetching documentation](/docs/basic-features/data-fetching.md): - -## `getInitialProps` (for older versions of Next.js) +> **Recommended: [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation) or [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering)** +> +> If you're using Next.js 9.3 or newer, we recommend that you use `getStaticProps` or `getServerSideProps` instead of `getInitialProps`. +> +> These new data fetching methods allow you to have a granular choice between static generation and server-side rendering. +> Learn more on the documentation for [Pages](/docs/basic-features/pages.md) and [Data fetching](/docs/basic-features/data-fetching.md):
Examples