|
|
@ -56,11 +56,16 @@ class CommentBox extends React.Component {
|
|
56
|
56
|
constructor(props) {
|
|
57
|
57
|
super(props);
|
|
58
|
58
|
this.state = {data: []}
|
|
|
59
|
|
|
|
60
|
this.handleCommentSubmit = this.handleCommentSubmit.bind(this);
|
|
59
|
61
|
}
|
|
60
|
62
|
|
|
61
|
63
|
handleCommentSubmit(comment) {
|
|
62
|
|
// TODO: Send to server and rerender
|
|
63
|
|
console.log("Got a comment: ", comment);
|
|
|
64
|
let comments = this.state.data;
|
|
|
65
|
let newComments = comments.concat([comment]);
|
|
|
66
|
this.setState({data: newComments});
|
|
|
67
|
|
|
|
68
|
// TODO: Send to server
|
|
64
|
69
|
}
|
|
65
|
70
|
|
|
66
|
71
|
componentDidMount() {
|