Commit 54c4839e authored by Benjamín Balun's avatar Benjamín Balun
Browse files

refactor: key prop removed from ItemCard component

parent c3eaa824
......@@ -7,14 +7,12 @@ import { Pokeball } from '../../data/pokeballs';
type Item = Food | Pokeball;
const ItemCard = ({
item,
key,
callback
}: {
item: Item;
key: number;
callback: (item: Item) => Promise<void>;
}) => (
<Col key={key} style={{ width: '200px' }}>
<Col style={{ width: '200px' }}>
<Card
title={item.name}
hoverable
......
......@@ -70,7 +70,7 @@ const Store = () => {
<>
<Funds funds={userData?.actualScore} />
<Row gutter={[10, 10]}>
<Row gutter={[10, 10]} align="middle">
{[...food, ...pokeballs].map((item, index) => (
<ItemCard item={item} key={index} callback={buyItem} />
))}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment