Skip to content

Commit 5892e51

Browse files
Dan PadmoreDaniel15
Dan Padmore
authored andcommitted
Update tutorial.md (reactjs#366)
* Update tutorial.md Correct the highlighted line to match the change that is being discussed, namely that the CommentForm can call the callback when the user submits the form * Update tutorial.md Also highlight changed line where onSubmit event handler is added to form tag. * Update tutorial_aspnet4.md Corrects the highlighted line in aspnet4 tutorial, to match the change that is being discussed, namely that the CommentForm can call the callback when the user submits the form * Update tutorial_aspnet4.md Also highlight changed line in aspnet4 tutorial, where onSubmit event handler is added to form tag. * Update tutorial.md Highlight complete block of added code lines. * Update tutorial_aspnet4.md Highlight complete block of added codes lines, in optimization part of tutorial.
1 parent f94e8b4 commit 5892e51

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

site/jekyll/getting-started/tutorial.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ React attaches event handlers to components using a camelCase naming convention.
697697

698698
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.
699699

700-
```javascript{2-13,16-18}
700+
```javascript{2-13,16-18,23}
701701
var CommentForm = React.createClass({
702702
getInitialState: function() {
703703
return {author: '', text: ''};
@@ -785,7 +785,7 @@ var CommentBox = React.createClass({
785785

786786
Now that `CommentBox` has made the callback available to `CommentForm` via the `onCommentSubmit` prop, the `CommentForm` can call the callback when the user submits the form:
787787

788-
```javascript{9}
788+
```javascript{18}
789789
var CommentForm = React.createClass({
790790
getInitialState: function() {
791791
return {author: '', text: ''};
@@ -889,7 +889,7 @@ Continue on for more awesomeness!
889889

890890
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.
891891

892-
```javascript{12-14}
892+
```javascript{12-18}
893893
var CommentBox = React.createClass({
894894
loadCommentsFromServer: function() {
895895
var xhr = new XMLHttpRequest();

site/jekyll/getting-started/tutorial_aspnet4.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ React attaches event handlers to components using a camelCase naming convention.
656656

657657
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.
658658

659-
```javascript{2-13,16-18}
659+
```javascript{2-13,16-18,23}
660660
var CommentForm = React.createClass({
661661
getInitialState: function() {
662662
return {author: '', text: ''};
@@ -744,7 +744,7 @@ var CommentBox = React.createClass({
744744

745745
Now that `CommentBox` has made the callback available to `CommentForm` via the `onCommentSubmit` prop, the `CommentForm` can call the callback when the user submits the form:
746746

747-
```javascript{9}
747+
```javascript{18}
748748
var CommentForm = React.createClass({
749749
getInitialState: function() {
750750
return {author: '', text: ''};
@@ -848,7 +848,7 @@ Continue on for more awesomeness!
848848

849849
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.
850850

851-
```javascript{12-14}
851+
```javascript{12-18}
852852
var CommentBox = React.createClass({
853853
loadCommentsFromServer: function() {
854854
var xhr = new XMLHttpRequest();

0 commit comments

Comments
 (0)