<div className="catalog-mobile__counter" key={cart.find(item => item.product._id === product._id) ? cart.find(item => item.product._id === product._id).quantity : "" }>
<div className="catalog-mobile__minus"></div>
<input type="text" defaultValue={cart.find(item => item.product._id === product._id) ? cart.find(item => item.product._id === product._id).quantity : "" } />
<div className="catalog-mobile__plus"></div>
</div>
<>
{cart.map(item => (
<div className="catalog-mobile__counter" key={item.product._id}>
<button className="catalog-mobile__minus"></button>
<input type="text" defaultValue={item.quantity || ''} />
<button className="catalog-mobile__plus"></button>
</div>
))}
</>