I am trying to change the state of an item in the array. I did what you commented on the previous answer but when I console.log the array I am updating it grows in number! This is the code

```
changeState = (i) => {
  console.log(this.state.selected)
  const array = [...this.state.selected];

  if (this.state.selected[i] === true) {
    array[i] = false
  } else {
    array[i] = true
  }

  this.setState({
    selected: array
  })

  console.log(array[i])
}

```

When I run the screen I create the selected array with all values in false, then when pressing the button, it sends the index using "i" and then the array instead of changing from true to false or viceversa, the array only increases in size