Skip to content

Commit

Permalink
Merge pull request #316 from benjamin-atkin/patch-1
Browse files Browse the repository at this point in the history
add initialization of state to States
  • Loading branch information
rstacruz authored Dec 10, 2017
2 parents 2f0b34c + d7ab72a commit 97a5b71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions react.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ See: [Properties](https://reactjs.org/docs/tutorial.html#using-props)

### States

```jsx
constructor(props) {
super(props)
this.state = {}
}
```

```jsx
this.setState({ username: 'rstacruz' })
```
Expand Down

0 comments on commit 97a5b71

Please sign in to comment.