After some digging i found out that its about the columns.
SO in my case, these are my columns, I want to pass in a fontawesome ! icon, that changes color depending on the value to the first column ("red" would make a red exclamation, "yellow" would make a yellow exclamation, etc).
you grab the value through the props passed in, to change the css class and you render the icon by just returning the font awesome icon.
columns: [
{
accessor: "color",
Header: "",
Cell: (props) => (
<FontAwesomeIcon
icon={faExclamationCircle}
className={"icon__" + props.value}
/>
),
},
{
accessor: "employeeId",
Header: "Employee ID",
},
{
accessor: "cvfs",
Header: "CVFS Net Change",
},
{
accessor: "totalAlerts",
Header: "Total Alerts",
},
],
data: [
{
employeeId: "11192",
cvfs: -42,
totalAlerts: 12,
color: "red",
},
{
employeeId: "12372",
cvfs: -38,
totalAlerts: 9,
color: "red",
},
{
employeeId: "17829",
cvfs: -31,
totalAlerts: 8,
color: "orange",
},
{
employeeId: "97283",
cvfs: -22,
totalAlerts: 6,
color: "orange",
},
{
employeeId: "76363",
cvfs: -10,
totalAlerts: 2,
color: "yellow",
},
]