I wonder how I can pass to prop conditionally to my react-table accessor.
eg: I have a data like this:
const data = [
{
name: 'Something',
isA: false,
isB: false,
isC: true
},
{
name: 'Something 2',
isA: true,
isB: false,
isC: false
},
{
name: 'Something 3',
isA: false,
isB: false,
isC: true
},
];
and my two columns:
const columns = [
{ Header: 'Name', accessor: 'name' },
{ Header: 'Is What?', accessor:'?' },
];
Here is in second column accessor how will work like that?
accessor will be that which one of isA, or isB, or isC true, so if isA true accessor will be isA, if isB accessor will be isB ....
How to know it?