Question: I have this.state with an array, and in array I want to change title, but it is not working. Help me please

Code:

```html
 this.state = 
       {
         list: [{title: "1"}, {title: "2"}], 
       }

       // changing title

       this.setState({
 this.state.list.title: "newTitle"
  }],
```

Answer: 
try this

```
this.setState({
    list: [{title: 'new title'}, { title: 'other title' }]
});

```

Example 

```
class App extends React.Component {
    state = { list: [{title: "1"}, {title: "2"}] };

    updateTitle = (index) => {
        var { list } = this.state;
        list[index].title = `Updated title ${index}`;
        this.setState({list});
  }

  updateTitles = () => {
    var { list } = this.state;
    list.forEach((item, k) => {
      item.title = `Title ${k}`;
    });
    this.setState({list});
  }

    render(){
        var { list } = this.state;
        return (
            <div>
        <button onClick={this.updateTitles}>Update Title</button>
        <ul>
          {list.map((item, k) => (
            <li onClick={() => this.updateTitle(k)} key={item.title}>{item.title}</li>
          ))}
        </ul>
      </div>
        );
    }
}

```
I can't get your question correctly. If you want to change value of title key of every child of list array just declare a function like this

```
function changeValue () {
    let newList = this.state.list
    newList.forEach(item => {
        item.title = 'newTitle'
    })
    this.setState = ({
        list: newList
    })
}

```