title: ReactJS - push json into state array
body: <p>I'm simply trying to append a <code>json</code> created dynamically into an <code>array</code> that lives inside the <code>state</code>.
  The only way that I've found till now is to use concat, because push doesn't work.</p>
  
  <pre><code>    constructor() {
          super()
          this.state = {
              list: []
          }
          this.add = this.add.bind(this)
      }
  
      add(e) {
          e.preventDefault()
          var task = document.getElementById('task').value
          var json = JSON.parse(JSON.stringify({key: task, item: task}))
          this.setState({list: this.state.list.concat(json)}) // WORKS
          // this.setState({list: this.state.list.push(json)}) // DOESN'T WORK
  
          console.log(this.state.list)
          document.getElementById('task').value = ''
  
      }
  </code></pre>
  
  <p>That works, but I don't understand why I have an empty array in console after the first item it's created. I've read how concat works, but obviously I missed something. Why I can't push an object inside my this.list array?</p>