|
@@ -86,6 +86,9 @@ let CommentBox = React.createClass({
|
|
getInitialState: function () {
|
|
getInitialState: function () {
|
|
return { data: [] };
|
|
return { data: [] };
|
|
},
|
|
},
|
|
|
|
+ handleCommentSubmit: function (comment) {
|
|
|
|
+ // TODO send request to the server and refresh the list.
|
|
|
|
+ },
|
|
loadCommentsFromServer: function () {
|
|
loadCommentsFromServer: function () {
|
|
$.ajax({
|
|
$.ajax({
|
|
url: this.props.url,
|
|
url: this.props.url,
|
|
@@ -104,7 +107,7 @@ let CommentBox = React.createClass({
|
|
<div className="commentBox">
|
|
<div className="commentBox">
|
|
<h1>Comments</h1>
|
|
<h1>Comments</h1>
|
|
<CommentList data={this.state.data} />
|
|
<CommentList data={this.state.data} />
|
|
- <CommentForm />
|
|
|
|
|
|
+ <CommentForm onCommentSubmit={this.handleCommentSubmit} />
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|