react useState update object in array of objects
this.setState({items: this.state.items.map(x => x.id === someId ? {...x, attr:'val'} : x)});
Source: stackoverflow.com
this.setState({items: this.state.items.map(x => x.id === someId ? {...x, attr:'val'} : x)});