I am using material UI Grid and Card to create a Card Grid.
Here is my code :
class CardList extends React.Component {
render() {
const cardComponent = CardSeed.cards.map((card) => (
<Card
className="cards"
key={'card-' + card.id}
id={card.id}
header={card.header}
title={card.title}
category={card.category}
summary={card.summary}
/>
));
return (
<Grid direction="row" container spacing={4}>
<Grid item xs={1}>
{cardComponent}
</Grid>
</Grid>
);
}
}
export default CardList;
I am wondering why the grid is rendering vertically and not horizontally, without the map function the grid is rendered Horizontally.