Skip to content

Commit 49f3648

Browse files
committed
Fix unique key warning in React console
1 parent ea006c9 commit 49f3648

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

components/Cart/CartPage/MobileCart.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const MobileCart = ({ cart, handleRemoveProductClick, updateCart }) => {
2727
{cart.products.length &&
2828
cart.products.map((item) => (
2929
<MobileCartItem
30-
key={item.productId}
30+
key={item}
3131
item={item}
3232
products={cart.products}
3333
handleRemoveProductClick={handleRemoveProductClick}

components/Cart/CartPage/RegularCart.component.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import CartItem from './CartItem.component';
22

3-
const RegularCart = ({ cart, handleRemoveProductClick, updateCart, updateCartProcessing }) => {
3+
const RegularCart = ({
4+
cart,
5+
handleRemoveProductClick,
6+
updateCart,
7+
updateCartProcessing,
8+
}) => {
49
return (
510
<table className="hidden table-auto md:block lg:block xl:block">
611
<thead>
@@ -25,10 +30,10 @@ const RegularCart = ({ cart, handleRemoveProductClick, updateCart, updateCartPro
2530
{cart.products.length &&
2631
cart.products.map((item) => (
2732
<CartItem
28-
key={item.productId}
33+
key={item}
2934
item={item}
3035
products={cart.products}
31-
handleRemoveProductClick={handleRemoveProductClick}
36+
handleRemoveProductClick={handleRemoveProductClick}
3237
updateCart={updateCart}
3338
updateCartProcessing={updateCartProcessing}
3439
/>

0 commit comments

Comments
 (0)