I have a list of items in an array i looped through that array and dynamicaly show the items list with add and remove button.
add and remove button add or remove the items to the users newly list same as add to cart and remove from the cart.
now what i want that if the user added the item once in cart or list then the button get disabled so it wont add the same item again and again in his list or cart.
is there any way i can achieve this?
<div key={shoe.id}>
<h5>{shoe.name}</h5>
<button onClick={() => addItem(shoe)}>add</button>
<button onClick={() => removeItem(shoe.id)}>remove</button>
</div>