score:1

the reason behind .map() is you get an opportunity to manipulate your array elements by accessing each elements and returning a different way, structure. in react case it helps to render proper jsx elements for render() method. suggested read lists and keys from react's official documentation.

read from array.prototype.map() documentation:

the map() method creates a new array populated with the results of calling a provided function on every element in the calling array.

first issue is wrongly passed properties to setstate(), please note that i'm using : instead of =. try to change as the following:

this.setstate({
   isload: true,
   items: json,
});

additionally you can try the following - you had the same name for current element as the array itself - it just better to have different name:

return <div>
     <ul>
         {items && items.map(e => <li key={e.name}> {e.name} </li>)}
     </ul>
</div>

i hope that helps!


Related Query

More Query from same tag