I'm using react, I'm creating an ecommerce, when I choose how many products I want to add to my cart, everything works fine, but when I navigate to another product, the last quantity added in the input number is not updated, for example, if I add 4 to a product and I pass to another product the value in that remains at 4 instead of being 1
this is my code
(<Link to={"/cart"} className="btn btn-success text-light"> <button className="btn btn-success text-light mt-2">Terminar Compra 💸</button> </Link>)
: (<input onClick={count} type={"number"} min={"1"} max={Stock} defaultValue="1" ></input>)}
</div>