React modifies the value of the array in state according to id, how to optimize it, and write it elegantly.

this.state = {
    list:[
        {
            id:1,
            name:"list1",
            editing:false
        },
        {
            id:2,
            name:"list2",
            editing:false
        },
        {
            id:3,
            name:"list3",
            editing:false
        }
    ]
}
handleClick=(id)=>{
        for(let i=0;i<this.state.list.length;iPP){
            if (this.state.list[i].id===id){
                this.state.list[i].editing=true
                break
            }
        }
        this.setState({
            list:this.state.list
        })
    }

for example, to modify how id=1 "s editing=true is written elegantly, the for loop I wrote looks very low.

.
Jan.08,2022

const newList = list.map(v => {
    const newV = {
        ...v,
        editing: v.id === 1
    }
    return newV;
})

handleClick (id) {
    this.setState({list:this.state.list.map(val=>{val.id==id&&(val.editing=true));return val;}})    
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b779-34662.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b779-34662.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?