Skip to content

Commit

Permalink
Add notice about getInitialProps (#1140)
Browse files Browse the repository at this point in the history
* Add notice about getInitialProps

* Remove extra whitespace
  • Loading branch information
timneutkens authored and arunoda committed Feb 15, 2017
1 parent acc1983 commit 2c85b36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c85b36

Please sign in to comment.