Typescript issues
I have this props:
and I create my columns dynamically, like so:
The problem is that if I remove any of the following "any" types:
Then I get the following error:
I have tried changing it to object and other React Table types but without success. Did someone have a similar issue? Am I creating the createColumnHelper method with the correct type according to my table props?
Thanks!
interface TableProps {
columns: {
title: string;
id: string;
}[];
rows: object[];
}and I create my columns dynamically, like so:
const columnHelper = createColumnHelper<object>();
const columns = tableColumns.map(({ id, title }) =>
columnHelper.accessor(id, {
header: title,
cell: (data) => data.getValue(),
})
);The problem is that if I remove any of the following "any" types:
header: ({ table }: { table: any }) =>
...
cell: ({ row, getValue }: { row: any; getValue: any })
...
getSubRows: (row: any) => row.subRows,
...
Then I get the following error:
I have tried changing it to object and other React Table types but without success. Did someone have a similar issue? Am I creating the createColumnHelper method with the correct type according to my table props?
Thanks!