#Dynamically change the header of a column

3 messages · Page 1 of 1 (latest)

drowsy walrus
#

Is there a way to dynamicaly change the header of a column?
For example, if I pass a boolean of true, I want to render a 'True' for the header, and if its false, I want to render 'False'

#

Something like context.getValue() that we can access in cell

#

Something like this?

const columns: ColumnDef<CustomerFileAdTableType>[] = [
  {
    accessorKey: 'comment',
    header: (context) => <>{context.getValueMaybe()}<>,
  },
];