Answer the question
In order to leave comments, you need to log in
How to display posts from an array on a page?
I'm making a blog site, you just need to display two posts per page. The "like", "comment" and "read more" buttons shouldn't have functionality right now, they're just for visualization at the moment. I will work on their functionality later.
Posts are stored in objects that are in an array.
I tried to do this task but the code doesn't work...
Here is the code:
https://jsfiddle.net/txo4g01y/9/
Please help me to fix the code.
Answer the question
In order to leave comments, you need to log in
You need to change the id in HTML and the name of the class. Because your names don't match
ReactDOM.render(<App automobile={data} />, document.getElementById('app'));
render () {
const automobile = this.props.automobile;
return (
<div>
{automobile.map(n => (
<div className="Cars" headerText={n.name}>
....
</div>
))}
</div>
);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question