skip to Main Content

Reactjs – Array.prototype.map() expects a value to be returned at the end of arrow function array-callback-return

{all_product.map((e)=>{ if(cartItems[e.id]>0){ return( <div> <div className="cartitems-format"> <img src={e.image} alt="" className='carticon-product-icon'/> <p>{e.name}</p> <p>${e.new_price}</p> <button className='cartitems-quantity'>{cartItems[e.id]}</button> <p>{e.new_price*cartItems[e.id]}</p> <img src={remove_icon} onClick={()=>{removeFromCart()}} alt="" /> </div> </div> ) } })} In the above it is showing the warning message and showing error in the webpage

VIEW QUESTION
Back To Top
Search