Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const dataTable = React.createRef();
useEffect(() => {
MDCDataTable.attachTo(dataTable.current);
});
return (
<div>
{props.rowSelection ? : null}
{props.data.headers.map((header, index) => {header})}
{props.rowSelection ? : null}
{row.map((content, index) => {
let id = index === 0 ? rowId : null;
return {content};
})}
<table>
<thead>
<tr></tr>
</thead>
<tbody></tbody></table>
{props.data.rows.map((row, index) => {
const isSelected = props.rowSelection ? props.data.selectedRowIndexes.indexOf(index) >= 0 : false;
const rowId = `u${idIncrement++}`;
return (
);
})}
</div>