1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Merge branch 'patch-3' of https://github.com/timoxley/next.js into timoxley-patch-3

This commit is contained in:
nkzawa 2016-11-04 20:37:36 +09:00
commit 060480f212

View file

@ -128,6 +128,8 @@ export default class extends React.Component {
Notice that to load data when the page loads, we use `getInitialProps` which is an [`async`](https://zeit.co/blog/async-and-await) static method. It can asynchronously fetch anything that resolves to a JavaScript plain `Object`, which populates `props`.
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 and the `props.url`.
`getInitialProps` receives a context object with the following properties:
- `pathname` - path section of URL