Solutionunvalidated
Add stable `id` fields to the product data (e.g., in `data.json`) so each item has an intrinsic id. Then dispatch/use the item’s existing id so the `id` comparisons correctly detect items already in the cart and conditionally render the quantity controls.
edf7e1a9-eec9-4e9f-bc95-3750b111bcc6
Add stable id fields to the product data (e.g., in data.json) so each item has an intrinsic id. Then dispatch/use the item’s existing id so the id comparisons correctly detect items already in the cart and conditionally render the quantity controls.