TanStackT
TanStack2y ago
3 replies
unexpected-ivory

Can't access accessorKey when mapping ColumnDef array

Trying to map over columns to change the cell property based on a selected value in the component but the accessorKey property isn't accessible. If I log the items out while mapping, there's clearly an accessorProperty. I read the reason why it's not but I'm not sure what to do. Is there a better way to do this? Am I supposed to be doing this in the component rather than the columns? I feel like I should be able to render the content dynamically via the columns property. Is my only recourse to use the header property?
Was this page helpful?