I work on a project in React, and I have an input in a table for the quantity of a product I want to buy, and I can't change the value on the web page.
If I delete the value property, I can modify the value, and I think I typed something wrong. Can somebody help me with how to have an initial value equal to 1 and still be able to update it?
<input
type="text"
id={"cantitate_" + index}
value={1}
onChange={(e) => changeQuantity(e.target.value, index)}
/>
changeQuantity is a function where I try to calculate something.