Closed slhsxcmy closed 4 months ago
CI is running/has finished running commands for commit 697696557a682b23ba34209bfc006de1b51cefc0. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
Sent with 💌 from NxCloud.
Hello everyone,
While this works with helper.accessor({}).accessorKey, it doesn't seem to work for something like this
const columns: ColumnDef<T>[] = [
helper.accessor('example' ,{ example})
...
]
columns.map(c => c.accessorKey)
Error:
Property 'accessorKey' does not exist on type 'ColumnDef<TData>'.
Property 'accessorKey' does not exist on type 'ColumnDefBase<TData, unknown> & StringHeaderIdentifier'.
My use case here is that I pass columns as props for a wrapper component of the table and I have some options where I need to access the accessorKey of the columns
Sorry for bad english
@edgarbagagem try typing the columns AccessorKeyColumnDef<T>[]
or leave out the type to let Typescript infer
AccessorKeyColumnDef
has accessorKey
but ColumnDef
doesn't
Fixes https://github.com/TanStack/table/issues/5423
Updates return type of the columns created by