Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constructor(props) {
- super(props)
- this.state = {
- post: [{
- nome: '',
- conteudo: '',
- comment: false
- }]
- }
- this.handleClickComment = this.handleClickComment.bind(this)
- }
- handleClickComment(postagem) {
- let indice = postagem.id -1
- let comment = this.state.comment ? false : true
- this.setState({...this.state.post[indice], comment})
- }
Add Comment
Please, Sign In to add comment