Javascript – Changing a value of an object of a state variable array
I have an array of objects as a state variable. I am trying to write a function that changes a field in one of the objects. interface IItem{ id: string, selected: boolean } const [array, setArray] = useState<IItem[]>([]) const toggleItem…