I have a repeating element that has a button. When a user clicks that button, I want to increment one value in the array that matches the element that contained the button
[{
item: 'data1',
count: 1
},
{
item:'data2',
count: 1
}
]
I've tried to set this up in a variety of ways and haven't been able to find the right path (Still struggling with shifting my regular coding mental model over)
My thought was that onClick, I'd access the index of the item in the array, and increment the count on that item (or use a piece of data on the object and run a find, update that object, then rewrite the variable), but I can't seem to figure out how to update the array or make a new version with only that one item changed (i figure out a flow, but then can't find a piece of data.