How to properly setState to array of objects? : <p>I have an array ob objects that creates <code>Close</code> buttons depending on how many there are of them. When i click <code>Close</code> button i would expect the array to be updated (removed) then the button element will disappear from screen. </p>

<p>I have worked out in <code>console.log</code> but unable to properly do setState :( </p>

<p>Example code here: <a href="https://codesandbox.io/s/sharp-kilby-hn2d9" rel="nofollow noreferrer">https://codesandbox.io/s/sharp-kilby-hn2d9</a></p>

<p>Any help would be greatly appreciated, i believe it's just the formatting of setState i need to do it properly, but because its array of an objects and so on i just cant figure that one out.  </p>
