Skip to content

Commit 2e2bcbd

Browse files
committed
Merge pull request #2360 from beausmith/patch-1
Highlighted changed lines in examples
1 parent 9d2ab67 commit 2e2bcbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ var CommentBox = React.createClass({
413413

414414
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.
415415

416-
```javascript{3,19-20,34}
416+
```javascript{3,14,19-20,34}
417417
// tutorial14.js
418418
var CommentBox = React.createClass({
419419
loadCommentsFromServer: function() {
@@ -476,7 +476,7 @@ var CommentForm = React.createClass({
476476

477477
Let's make the form interactive. When the user submits the form, we should clear it, submit a request to the server, and refresh the list of comments. To start, let's listen for the form's submit event and clear it.
478478

479-
```javascript{3-14,17-19}
479+
```javascript{3-14,18-20}
480480
// tutorial16.js
481481
var CommentForm = React.createClass({
482482
handleSubmit: function(e) {

0 commit comments

Comments
 (0)