Update README.md

This commit is contained in:
Guillermo Rauch 2016-10-31 18:13:42 -07:00 committed by GitHub
parent 07dbf2a20c
commit c3ae04b69a

View file

@ -106,7 +106,7 @@ export default () => (
### Component lifecycle
When you need state, lifecycle hooks or **initial data population** you can export a `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`.
When you need state, lifecycle hooks or **initial data population** you can export a `React.Component`.
```jsx
import React from 'react'
@ -124,6 +124,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`.
### Routing
Client-side transitions between routes are enabled via a `<Link>` component