Add notice about getInitialProps (#1140)

* Add notice about getInitialProps

* Remove extra whitespace
This commit is contained in:
Tim Neutkens 2017-02-15 03:58:13 +01:00 committed by Arunoda Susiripala
parent acc1983f80
commit 2c85b367ce

View file

@ -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