@ -411,7 +411,7 @@ var CommentBox = React.createClass({
Here, `componentWillMount` is a method called automatically by React before 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.
```javascript{3,16-17,31}
```javascript{3,19-20,34}
// tutorial14.js
var CommentBox = React.createClass({
loadCommentsFromServer: function() {
@ -420,6 +420,9 @@ var CommentBox = React.createClass({
@ -632,7 +644,7 @@ var CommentBox = React.createClass({
Our application is now feature complete but it feels slow to have to wait for the request to complete before your comment appears in the list. We can optimistically add this comment to the list to make the app feel faster.
```javascript{13-15}
```javascript{16-18}
// tutorial20.js
var CommentBox = React.createClass({
loadCommentsFromServer: function() {
@ -641,6 +653,9 @@ var CommentBox = React.createClass({