score:7

Accepted answer

Remove curly brace:

const connectedList = ({ articles }) =>(
   articles.map(e=>( // implicit return
      <li key={e.id}>{e.title}</li>
   )
));

Or, using curly brace:

const connectedList = ({ articles }) => { // no parentheses
   return articles.map(e=>( // explicitly use return
      <li key={e.id}>{e.title}</li>
   )
});

Using curly brace in parentheses indicates that you're returning an object. But articles.map... is obviously not an object rather looping through an object.


Related Query

More Query from same tag