0

below is my code :

{product.countInStock === 0 ? (
          <Button variant=”light” disabled>
          out of stock
          </Button>
        ) : (
          <Button onClick={() => addToCartHandler(product)}>
            add to cart
          </Button>
        )}

here is the problem:
product.countInStock is always 10, how should I change countInStock to 0?
thank you, sir.

grata Asked question March 20, 2023