|
|
|
@ -6,10 +6,6 @@ class App extends React.Component {
|
|
|
|
constructor(props){
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.addComment = this.addComment.bind(this);
|
|
|
|
this.addComment = this.addComment.bind(this);
|
|
|
|
this.state = {
|
|
|
|
|
|
|
|
comments: [
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
addComment(value){
|
|
|
|
addComment(value){
|
|
|
|
this.state.comments.push({ body: value });
|
|
|
|
this.state.comments.push({ body: value });
|
|
|
|
@ -19,7 +15,7 @@ class App extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return <section>
|
|
|
|
return <section>
|
|
|
|
<CommentsList comments={this.state.comments}/>
|
|
|
|
<CommentsList/>
|
|
|
|
<CommentsForm handleSubmit={this.addComment}/>
|
|
|
|
<CommentsForm handleSubmit={this.addComment}/>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|