So I have a item that is an object in my array state items.
I'm also getting the item-content (with its ID) and index of the current item into the function indexMove.
So indexMove is a function that is fired when I'm pressing a specific item from items.
My goal is that when indexMove is pressed the index number of the item decreases by 1 so it moves UP in the list. However the item at index 0 should just stop and not be able to move further up.
I really hope I'm being clear because it's a bit hard to explain, but how would I write this to change the items by index? Thank you
const [items, setItems] = useState([])
const indexMove = (item, index) =>{
console.log(item)
console.log(index)
}

