对象作为 React 无效

问题描述 投票:0回答:0

我不确定为什么会收到此错误,我的第一个循环工作正常,因为我能够打印出这些值,但第二个循环一直在拉这个错误。我曾尝试更改为常规地图,但也出现了错误。不确定第二个循环中发生了什么。

  const TableRows = (rows) => {
    const row = Object.entries(rows).map((owner, mainIndex) => {
      return (
        <TableRow key={console.log(`row-record-${owner[0]}`)} highlightOnHover={true}>
          {Object.entries(owner).map((value, index) =>  (
            <TableCell
              key={`column-value-${value}`}
              alignmentHorizontal={
                tabsAlignment[props.metricComponent] &&
                props.componentName != "Open_COE_Default"
                  ? tabsAlignment[props.metricComponent][index]
                  : index != 0
                    ? "center"
                    : ""
              }
              sortColumn={value}
            >

              {loadData(value, index, owner, mainIndex)}
            </TableCell>
          ))}
        </TableRow>
      );
    });
    return row;
  };
javascript reactjs json javascript-objects
© www.soinside.com 2019 - 2024. All rights reserved.