I created a map function which should map through an array and display the items of an array, but for some reason, it doesn't work.
Here is the file with the array:
const AboutContents = [
{
id: 1,
image: "",
title: "Feature 1",
description: "Description goes here"
},
{
id: 2,
image: "",
title: "Feature2",
description:"Description goes here"
},
{
id: 3,
image: "",
title: "Feature 3",
description: "Description goes here"
}
];
export default AboutContents;
And here is the Entry file:
import React from "react";
import AboutContent from "./AboutContent"; //Probably unnecessary
function Entry(props) {
return (
<div>
<img src={props.image} alt="" width="500" height="600"></img>
<h3>{props.title}</h3>
<p>{props.description}</p>
</div>
);
}
export default Entry;
And here is the About.jsx file. This is where the map function is at Note: I am alse using react-bootstrap, but I don't think that that would be the problem:
import React from "react";
import Entry from "./Entry";
import AboutContents from "./AboutContent";
import { Container, Row, Col } from "react-bootstrap";
function About(props) {
return (
<div>
<h1 class="aboutText">About</h1>
<Container fluid>
<div class="row">
{AboutContents.map(aboutItem => {
return(
<div class='col-lg-4 col-md-4'>
<Entry
key={AboutContents.id}
image={AboutContents.image}
title={AboutContents.title}
description={AboutContents.description}
/>
</div>
)
})}
</div>
</Container>
</div>
);
}
export default About;