This is working for me.
You should change Contact.c
to Contact[c]
.
import "./styles.css";
import React, {useState} from 'react';
export default function CustomColumn(){
const [CCcontact, setCCContact] = useState([
{a: "aa"},
{b: "bb"},
{c: "cc"},
{d: "dd"}
]);
const [cc, setCc] = useState([
{name: "a"},
{name: "b"},
{name: "c"},
{name: "d"},
]);
return (
<>
<div className="w-75 hi">
<table className="table">
<thead className="thead-dark">
<tr>
{cc.map((cc) => {
return <th scope="col">{cc.name}</th>;
})}
</tr>
</thead>
<tbody>
{CCcontact.map((contact) => {
return (
<tr>
{cc.map((column) => {
let c = column.name
//this isn't working
return <td>{contact[c]}</td>;
})}
</tr>
);
})}
</tbody>
</table>
</div>
</>
);
}