File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
site/jekyll/getting-started Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -706,7 +706,7 @@ var CommentForm = React.createClass({
706
706
707
707
Now that the callbacks are in place, all we have to do is submit to the server and refresh the list:
708
708
709
- ``` javascript{12-21}
709
+ ``` javascript{12-21,44 }
710
710
var CommentBox = React.createClass({
711
711
loadCommentsFromServer: function() {
712
712
var xhr = new XMLHttpRequest();
@@ -719,8 +719,8 @@ var CommentBox = React.createClass({
719
719
},
720
720
handleCommentSubmit: function(comment) {
721
721
var data = new FormData();
722
- data.append('Author', comment.Author );
723
- data.append('Text', comment.Text );
722
+ data.append('Author', comment.author );
723
+ data.append('Text', comment.text );
724
724
725
725
var xhr = new XMLHttpRequest();
726
726
xhr.open('post', this.props.submitUrl, true);
@@ -748,6 +748,11 @@ var CommentBox = React.createClass({
748
748
);
749
749
}
750
750
});
751
+
752
+ React.renderComponent(
753
+ <CommentBox url="/comments" submitUrl="/comments/new" pollInterval={2000} />,
754
+ document.getElementById('content')
755
+ );
751
756
```
752
757
753
758
## Congrats!
You can’t perform that action at this time.
0 commit comments