title: How can I insert into React's state array with setState?
body: <p>I'm looking to modify and array in react and insert elements on specific index. This is how my state looks like:</p>
  
  <pre><code>this.state = {arr: ['', '', '', '' ]}
  </code></pre>
  
  <p>What I wanna do is to compile this <code>arr[index] = 'random element'</code> to react js setState syntax. What I tried to do was:</p>
  
  <pre><code>this.setState({ arr[index]: 'random element' })
  </code></pre>
  
  <p>but failed, ty!</p>