From 2c85b367ce5d3fa5da88914570fab654d722a295 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Wed, 15 Feb 2017 03:58:13 +0100 Subject: [PATCH] Add notice about getInitialProps (#1140) * Add notice about getInitialProps * Remove extra whitespace --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a827b549..274a275d 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,8 @@ Notice that to load data when the page loads, we use `getInitialProps` which is For the initial page load, `getInitialProps` will execute on the server only. `getInitialProps` will only be executed on the client when navigating to a different route via the `Link` component or using the routing APIs. +_Note: `getInitialProps` can **not** be used in children components. Only in `pages`._ + `getInitialProps` receives a context object with the following properties: - `pathname` - path section of URL