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({
706706
707707Now that the callbacks are in place, all we have to do is submit to the server and refresh the list:
708708
709- ``` javascript{12-21}
709+ ``` javascript{12-21,44 }
710710var CommentBox = React.createClass({
711711 loadCommentsFromServer: function() {
712712 var xhr = new XMLHttpRequest();
@@ -719,8 +719,8 @@ var CommentBox = React.createClass({
719719 },
720720 handleCommentSubmit: function(comment) {
721721 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 );
724724
725725 var xhr = new XMLHttpRequest();
726726 xhr.open('post', this.props.submitUrl, true);
@@ -748,6 +748,11 @@ var CommentBox = React.createClass({
748748 );
749749 }
750750});
751+
752+ React.renderComponent(
753+ <CommentBox url="/comments" submitUrl="/comments/new" pollInterval={2000} />,
754+ document.getElementById('content')
755+ );
751756```
752757
753758## Congrats!
You can’t perform that action at this time.
0 commit comments