Skip to content

Update tutorial.md #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions site/jekyll/getting-started/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ React attaches event handlers to components using a camelCase naming convention.

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.

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

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:

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

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{12-14}
```javascript{12-18}
var CommentBox = React.createClass({
loadCommentsFromServer: function() {
var xhr = new XMLHttpRequest();
Expand Down
6 changes: 3 additions & 3 deletions site/jekyll/getting-started/tutorial_aspnet4.md
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ React attaches event handlers to components using a camelCase naming convention.

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.

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

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:

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

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{12-14}
```javascript{12-18}
var CommentBox = React.createClass({
loadCommentsFromServer: function() {
var xhr = new XMLHttpRequest();
Expand Down