Question: Trying to update one element of an array in this.state I'm getting an (expected ,) error but cant see where I've gone wrong. Do I need to create a temporary array update that, then assign the whole array back to the state

This is essentially what I have

```
this.state = { array: ['a', 'b', 'c'] };

onBack() {
  this.setState({
      array[2]: 'something' 
  });
}

```

Answer: 
using hooks
===========

```
const [totalSet, setTotalSet] = useState(null);

```

console.log(totalSet); // {sets: Array(3), subscribed: false}

```
setTotalSet(datas => ({
    ...datas,
    sets: updatedSet,
  }));

```
***Create a temporary array update that, then assign the whole array back to the state***

```
var arr = [];
arr = this.state.array;
arr[2] = "something";
this.setState({
    array : arr
});

```