Iterate in an array with objects

const BlogList = ({ list }) => {
  return (
    <div className="blog-list">
      {Object.keys(list).map((keyName, i) => (
    <li className="post" key={i}>

Here I am doing this way but it is giving me errors I don’t where I am doing wrong.The Api data is shown below:
“id” : “HktWbZ1ox”,
“thumbnail_image” : “”,
“event_name” : “Hello1”,
“event_date” : 1506988800,
“views” : 7,
“likes” : 3,
“shares” : 5

Are we allowed to know what the error messages are, or is this a riddle?

Can you console.log list so we can see exactly what is being passed in.

I don’t understand this:

      {Object.keys(list).map((keyName, i) => (

and this:


The first one implies that list is an object. But the second one implies that the list is the parent of the object that holds “thumbnail_image” - but that would be an array.

I think you have some confusion over what your data is.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.