React · Junior · Question 69 of 75
Why does this list render nothing?
{users.map((u) => {
<li key={u.id}>{u.name}</li>;
})}- ✓Correct answer: The arrow function has a block body without
return, so it returnsundefined - 2
mapdoesn't work in JSX - 3
keymust be on the<ul>
Explanation
Use parentheses for an implicit return: users.map((u) => (<li ...>)), or write return inside the braces.