const defaultColumn: Partial<ColumnDef<any>> = {
cell: (cellProps) => {
return <div style={{ color: 'red' }}>{cellProps.getValue() as string}</div>;
},
};
const columns = useMemo(
() => [
columnHelper.accessor('foo.bar', {
header: 'Bar',
cell: (props) => {
return (
<div>
{props.column.renderDefault(props.cell.getContext())} <--- Is this possible somehow? I want this to be the default cell renderer.
Very cool wrapper
</div>
);
},
}),
],
[]
);
const table = useReactTable({
data,
columns,
defaultColumn,
getCoreRowModel: getCoreRowModel(),
getFilteredRowModel: getFilteredRowModel(),
getPaginationRowModel: getPaginationRowModel(),
});
const defaultColumn: Partial<ColumnDef<any>> = {
cell: (cellProps) => {
return <div style={{ color: 'red' }}>{cellProps.getValue() as string}</div>;
},
};
const columns = useMemo(
() => [
columnHelper.accessor('foo.bar', {
header: 'Bar',
cell: (props) => {
return (
<div>
{props.column.renderDefault(props.cell.getContext())} <--- Is this possible somehow? I want this to be the default cell renderer.
Very cool wrapper
</div>
);
},
}),
],
[]
);
const table = useReactTable({
data,
columns,
defaultColumn,
getCoreRowModel: getCoreRowModel(),
getFilteredRowModel: getFilteredRowModel(),
getPaginationRowModel: getPaginationRowModel(),
});