But when I do a console.log(rows) I got an undefined list.
let rows: Array<{ id: number }> = []
rows = products?.map((product) =>
{ id: product.product_id }
)
When I try to do without map it works, like:
let rows = [
{id: 1},
{id: 2},
{id: 3},
]
The array "rows" going to be used in a DataGrid component of material-ui, so I need populate the array rows with map to stay equals the array above.