Babarparacha
Babarparacha

Reputation: 1

Could not fetch map

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

Answers (1)

Ahmad
Ahmad

Reputation: 1479

please try this {this.state.articles && this.state.articles.map((element)=>()={ return (here I am retrieve a div. )}} thanks

Upvotes: 1

Related Questions