dimanche 29 juillet 2018

Warning: Failed prop type: Invalid prop `children` supplied to `TableRow`

Using react-md, I'm trying to build a table from an array of objects. I have one fixed column header but everything else is generated by the keys in the first element of the array.

<TableHeader>
  <TableRow>
    <TableColumn>Actions</TableColumn>
    {Object.keys(list[0])
      .filter((key) =>
        Object.keys(SEARCH_RESULTS_LABELS).includes(key),
      )
      .map((key, i) => (
        <TableColumn key={i}>
          {SEARCH_RESULTS_LABELS[key]}
        </TableColumn>
      ))}
  </TableRow>
</TableHeader>

My fixed column is the <TableColumn>Actions</TableColumn> element. The moment I put it in, I get this error. When I remove it, the error goes away.

I'm not sure why this is happening, how do I get rid of the warning?




Aucun commentaire:

Enregistrer un commentaire