Skip to content

Commit 5fbf250

Browse files
committed
Merge pull request #73 from rickbeerendonk/Getting_Started_Update
Getting started corrections
2 parents 828c7cc + f1c4253 commit 5fbf250

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

site/jekyll/getting-started/tutorial.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ var CommentForm = React.createClass({
593593

594594
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.
595595

596-
```javascript{2-12,15-16,20}
596+
```javascript{2-13,16-18}
597597
var CommentForm = React.createClass({
598598
handleSubmit: function(e) {
599599
e.preventDefault();
@@ -679,7 +679,7 @@ var CommentForm = React.createClass({
679679
if (!text || !author) {
680680
return;
681681
}
682-
this.props.onCommentSubmit({author: author, text: text});
682+
this.props.onCommentSubmit({Author: author, Text: text});
683683
this.refs.author.getDOMNode().value = '';
684684
this.refs.text.getDOMNode().value = '';
685685
return;
@@ -711,8 +711,8 @@ var CommentBox = React.createClass({
711711
},
712712
handleCommentSubmit: function(comment) {
713713
var data = new FormData();
714-
data.append('Author', comment.author);
715-
data.append('Text', comment.text);
714+
data.append('Author', comment.Author);
715+
data.append('Text', comment.Text);
716716
717717
var xhr = new XMLHttpRequest();
718718
xhr.open('post', this.props.submitUrl, true);
@@ -868,7 +868,7 @@ If you go to this URL in your browser, you should notice that the code has been
868868

869869
Server-side rendering means that your application initially renders the components on the server-side, rather than fetching data from the server and rendering using JavaScript. This enhances the performance of your application since the user will see the initial state immediately.
870870

871-
We need to make some motifications to `CommentBox` to support server-side rendering. Firstly, we need to accept an `initialData` prop, which will be used to set the initial state of the component, rather than doing an AJAX request. We also need to remove the `loadCommentsFromServer` call from `getInitialState`, since it is no longer required.
871+
We need to make some motifications to `CommentBox` to support server-side rendering. Firstly, we need to accept an `initialData` prop, which will be used to set the initial state of the component, rather than doing an AJAX request. We also need to remove the `loadCommentsFromServer` call from `componentDidMount`, since it is no longer required.
872872

873873
```javascript{28}
874874
var CommentBox = React.createClass({
@@ -964,8 +964,6 @@ namespace ReactDemo
964964
{
965965
public static void Configure()
966966
{
967-
ReactSiteConfiguration.Configuration = new ReactSiteConfiguration();
968-
969967
ReactSiteConfiguration.Configuration
970968
.AddScript("~/Scripts/showdown.js")
971969
.AddScript("~/Scripts/Tutorial.jsx");

0 commit comments

Comments
 (0)