Skip to content

Commit

Permalink
Merge pull request #5712 from dortonway/master
Browse files Browse the repository at this point in the history
Fix misunderstanding in tutorial
  • Loading branch information
jimfb committed Dec 23, 2015
2 parents bae0f19 + 109c9a9 commit 4865ddf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ var CommentBox = React.createClass({
});
```

Here, `componentDidMount` is a method called automatically by React when a component is rendered. The key to dynamic updates is the call to `this.setState()`. We replace the old array of comments with the new one from the server and the UI automatically updates itself. Because of this reactivity, it is only a minor change to add live updates. We will use simple polling here but you could easily use WebSockets or other technologies.
Here, `componentDidMount` is a method called automatically by React after a component is rendered for the first time. The key to dynamic updates is the call to `this.setState()`. We replace the old array of comments with the new one from the server and the UI automatically updates itself. Because of this reactivity, it is only a minor change to add live updates. We will use simple polling here but you could easily use WebSockets or other technologies.

```javascript{3,15,20-21,35}
// tutorial14.js
Expand Down

0 comments on commit 4865ddf

Please sign in to comment.