0
 <Tooltip title={toolTip}>
  <a onClick={addToCartHandler}   
     className={quantity < 1 ? "disabledCursor" : "notDisabled"}> 
      <ShoppingCartOutlined className="text-warning" />  
           {quantity < 1 ? "Out of Stock" : "Add to cart"}
  </a>

Applied disable options on but onClick event performs again. Please help

  • https://stackoverflow.com/questions/28318057/html-how-to-disable-a-href –  Feb 06 '22 at 06:17

1 Answers1

0
<Tooltip title={toolTip}>
     <a onClick={addToCartHandler} style={quantity < 1 ? 
            { pointerEvents: "none" } : { pointerEvents: "auto " }} >
          
           <ShoppingCartOutlined className="text-warning" />
                   {quantity < 1 ? "Out of Stock" : "Add to cart"}
      </a>

In-stead of using with className I tried with applying style, and it worked.