I am quite new to ReactJS and still playing with the basic concepts, so the answer to my question might look obvious for pros ;)
I have a component as below:
import React from "react";
function NameList(props) {
const names = ["Bruce", "Clark", "Diana"];
return (
<div>
{names.map((x) => {
<h1>{x}</h1>;
console.log({ x });
})}
</div>
);
}
export default NameList;
Can someone tell me why the h1 tags are not rendered while the values are written in the console?