提交 d8cf0ba7 编写于 作者: T Tim Oxley 提交者: GitHub

Readme: Explain where & when getInitialProps executes

上级 c4d62610
......@@ -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 `props.url.pushTo` API.
### Routing
Client-side transitions between routes are enabled via a `<Link>` component
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册