Commit c3ae04b6 authored by Guillermo Rauch's avatar Guillermo Rauch Committed by GitHub

Update README.md

parent 07dbf2a2
...@@ -106,7 +106,7 @@ export default () => ( ...@@ -106,7 +106,7 @@ export default () => (
### Component lifecycle ### 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 ```jsx
import React from 'react' import React from 'react'
...@@ -124,6 +124,8 @@ export default class extends React.Component { ...@@ -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 ### Routing
Client-side transitions between routes are enabled via a `<Link>` component Client-side transitions between routes are enabled via a `<Link>` component
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment