I have object like this:
[{a:1, rows:[]},{a:2,rows:[]}]
I want to map the the a's as table columns and rows as cells.
I'm trying like this:
<thead>
<tr>
{doc.map(({
_id, rfqID, supplier, notes, rows,
}) => (
<th>{supplier}</th>
))}
</tr>
</thead>
<tbody>
{rows.map(({ offerPrice }) => (
<tr>
<td>1</td>
<td>{offerPrice}</td>
</tr>
))}
</tbody>
But I get Uncaught ReferenceError: rows is not defined
What is the correct syntax to map this table with headers & items?
rowsyou are referring is not in the scope.