Guest User

Untitled

a guest
Jul 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. constructor(props) {
  2. super(props)
  3.  
  4. this.state = {
  5. post: [{
  6. nome: '',
  7. conteudo: '',
  8. comment: false
  9. }]
  10. }
  11. this.handleClickComment = this.handleClickComment.bind(this)
  12.  
  13. }
  14.  
  15. handleClickComment(postagem) {
  16. let indice = postagem.id -1
  17. let comment = this.state.comment ? false : true
  18. this.setState({...this.state.post[indice], comment})
  19. }
Add Comment
Please, Sign In to add comment