So I am working on learning React, I am doing the Road To React book. In the book he used this code
const List = (props) => (
props.list.map(item => (
<div key={item.objectID}>
<span>
<a href={item.url}> {item.title} </a>
</span>
<span>
{item.author}
</span>
<span>{item.num_comments} </span>
<span>{item.points} </span>
</div>
))
)
And I used this code
const List = (props) => {
return props.list.map(item => {
<div key={item.objectID}>
<span>
<a href={item.url}> {item.title} </a>
</span>
<span>
{item.author}
</span>
<span>{item.num_comments} </span>
<span>{item.points} </span>
</div>
})
}
His worked and mine did not work, I been researching and I do not understand why, if someone can please help me understand why.