You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/jekyll/getting-started/tutorial.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -593,7 +593,7 @@ var CommentForm = React.createClass({
593
593
594
594
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.
595
595
596
-
```javascript{2-12,15-16,20}
596
+
```javascript{2-13,16-18}
597
597
var CommentForm = React.createClass({
598
598
handleSubmit: function(e) {
599
599
e.preventDefault();
@@ -679,7 +679,7 @@ var CommentForm = React.createClass({
@@ -711,8 +711,8 @@ var CommentBox = React.createClass({
711
711
},
712
712
handleCommentSubmit: function(comment) {
713
713
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);
716
716
717
717
var xhr = new XMLHttpRequest();
718
718
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
868
868
869
869
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.
870
870
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.
872
872
873
873
```javascript{28}
874
874
var CommentBox = React.createClass({
@@ -964,8 +964,6 @@ namespace ReactDemo
964
964
{
965
965
public static void Configure()
966
966
{
967
-
ReactSiteConfiguration.Configuration = new ReactSiteConfiguration();
0 commit comments