T
TanStack2y ago
stormy-gold

error when accessing accessorKey

Hello, Im tryng to get the accessorKey property from each row and i get the following error:
Property 'accessorKey' does not exist on type 'ColumnDef<TData, unknown>'.
Property 'accessorKey' does not exist on type 'ColumnDefBase<TData, unknown> & StringHeaderIdentifier'.ts(2339)
Property 'accessorKey' does not exist on type 'ColumnDef<TData, unknown>'.
Property 'accessorKey' does not exist on type 'ColumnDefBase<TData, unknown> & StringHeaderIdentifier'.ts(2339)
though in the docs it says that its accessible, here is my code:
{rowSelection?.getVisibleCells().map((cell) => (
<span className="w-min" key={cell.id}>
{cell.column.columnDef.accessorKey}:
{flexRender(
cell.column.columnDef.cell,
cell.getContext()
)}
</span>
))}
{rowSelection?.getVisibleCells().map((cell) => (
<span className="w-min" key={cell.id}>
{cell.column.columnDef.accessorKey}:
{flexRender(
cell.column.columnDef.cell,
cell.getContext()
)}
</span>
))}
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?