I am using PrimeReact Datatables and creating the columns dynamically from JSON. How do I render Boolean values in the table? Right now they are not showing up.
JSON Person Example
const person = [
{
"id":1,
"person":"John Smith",
"canEdit":false,
"canView":true
},
{
"id":2,
"person":"Frank Jones",
"canEdit":true,
"canView":true
}
]
Component
...
const dynamicColumns = columns.map((col,i) => {
return <Column key={col.field} field={col.field} header={col.header} />;
});
return (
<DataTable value={person}>
{dynamicColumns}
</DataTable>
)
...