Skip to content

Commit d6aa588

Browse files
committed
Merge pull request #2360 from beausmith/patch-1
Highlighted changed lines in examples
2 parents 31002e0 + df36c25 commit d6aa588

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/docs/tutorial.md

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

420420
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.
421421

422-
```javascript{3,19-20,34}
422+
```javascript{3,14,19-20,34}
423423
// tutorial14.js
424424
var CommentBox = React.createClass({
425425
loadCommentsFromServer: function() {
@@ -482,7 +482,7 @@ var CommentForm = React.createClass({
482482

483483
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.
484484

485-
```javascript{3-14,17-19}
485+
```javascript{3-14,18-20}
486486
// tutorial16.js
487487
var CommentForm = React.createClass({
488488
handleSubmit: function(e) {

0 commit comments

Comments
 (0)