Reputation: 1
I have a news website in react js(class base component) and I I want to get all the API using map()
.I have written the code below please solve it.
{this.state.articles.map((element)=>()={
Return (here I am retrieve a div.
)}}
But when I run this code the console respond that can not read the undefined map Please help.
Upvotes: 0
Views: 56
Reputation: 1479
please try this {this.state.articles && this.state.articles.map((element)=>()={ return (here I am retrieve a div. )}}
thanks
Upvotes: 1