Projects.js
constructor() {
super();
this.state = {
projects: []
}
}
componentWillMount() {
this.setState({
projects: [
{
link: '/',
img: 'img.jpg',
title: 'Title',
date: 'Jul 2017',
description: 'Description',
icons:
[
{
src: 'icon.svg',
content: 'Content'
},
{
src: 'icon2.svg',
content: 'Content 2'
]
}
]
});
}
render() {
return (
<section className="projects">
<ProjectsList projects={this.state.projects} />
</section>
);
}
}
ProjectsList.js
let projectItems;
projectItems = this.props.projects.map(project => {
return (
<ProjectItem key={project.title} project={project} />
)
});
return (
<div id="projectsList">
{projectItems}
</div>
)
I want to create a project card that has a list of icons on the bottom. I can map the projects array but the icons won't work. Anyone know how to map this 2d array in ReactJs? Thanks!