I have this column definition:
{
Header: 'result',
accessor: 'logs.digits_pressed',
disableSorting: true,
Cell: ( { cell } ) => (
cell.value ? ( <> <Intl id="listened" /> {': '} {cell.value} </> ) : ''
),
},
What i want to achieve is if that accessor logs.digits_pressed
is empty or not set, i want to show on that column a different accessor, something like (pseudocode):
accessor: 'logs.digits_pressed'
if cell.value == "" then
accessor: 'logs.option_listened'
if cell.value == "0" then
accessor: 'logs.message_listened'
Is this possible at all?
Many thanks!
David
question from:
https://stackoverflow.com/questions/65864160/react-table-set-accessor-dynamically 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…