Let's say I have an array and I'm mapping through it:
{items &&
items.map((item) => (
<div key={item}>
{item} <button>Delete</button>
</div>
))}
I'm keeping items in state hook - [items, setItems] = useState(itemsArray); How do I remove the item at its specific index when I click that 'Delete' button?