Answers for "render href react table cell"

1

render href react table cell

const TableBody = ({ getTableBodyProps, prepareRow, page }: BodyProps): JSX.Element => {
  return (
    <tbody {...getTableBodyProps()}>
      {page.map((row) => {
        prepareRow(row);
        const { key, ...restRowProps } = row.getRowProps();
        return (
          <tr key={key} {...restRowProps}>
            {row.cells.map((cell) => {
              const { key, ...restCellProps } = cell.getCellProps();
              return (
                <td key={key} {...restCellProps}>
                  {cell.column.id === "Column Name" ? <a href="link">Link</a> : cell.render("Cell")}
                </td>
              );
            })}
          </tr>
        );
      })}
    </tbody>
  );
};
Posted by: Guest on September-16-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language