title: Issue with React useState 2D array
body: <p>I am facing strange behavior with useState. In the sandbox <a href="https://codesandbox.io/s/elastic-ellis-gjre7" rel="nofollow noreferrer">https://codesandbox.io/s/elastic-ellis-gjre7</a> I have 3 input fields, that change value if you click on them. The problem is with history state, that I log in console.</p>
  <p>Expected behavior is, that as soon as you click on 1 of the boxes, it saves the state of all 3 boxes in history array, when we click another, it adds to history array new placements.</p>
  <p>When clicking 1 box, it works correctly - &quot;History 1&quot; shows placement, and &quot;History 2&quot; and &quot;History 3&quot; are undefined.</p>
  <p>But when we click 2nd box, it starts to act strange - It rewrites previously written &quot;History 1&quot;, so now the content for &quot;History 1&quot; and &quot;History 2&quot; are the same. Strange, because all we do is concatenate new value to history array, but it overwrites the previous values.</p>
  <p>Can anyone explain, why does it act in such a way?</p>