I am new to React and JS.
I have this piece of code but 'rows' is undefined in console.log output. I am guessing my map function is incorrect but I can't figure out why.
const stubData = [
{ id: "435879430589041", customer: "jdus", status: "OK" },
{ id: "435879430589042", customer: "jdfr", status: "OK" },
{ id: "435879430589043", customer: "jdnl", status: "pending" },
{ id: "435879430589044", customer: "wsi", status: "config" },
{ id: "435879430589045", customer: "tkmaxx", status: "pending" },
];
const Rows = () => {
const rows = stubData.map((c,i) => {
(<tr key={i} value={c}>
<td>{c.id}</td>
<td>{c.customer}</td>
<td>{c.status}</td>
</tr>)
});
console.log(rows)
return <tbody>{rows}</tbody>;
};
const ListIntegrations = props => {
return (
<table className="table table-hover">
<Headers />
<Rows />
</table>
);
Headers returns headers perfect.