I am using setState hook to set an object with an array similar to:
const [organisations, setOrganisations] = useState({
items: [],
hasMore: false,
});
items array looks similar to this:
[
0: {id: "2", name: "Test Internal 5", isInternal: true},
1: {id: "3", name: "Test Internal 6", isInternal: false}
]
i want to setState using spread syntax of item 1, setting isInternal property to true.
How can i do this?
Thanks