TanStackT
TanStack11mo ago
1 reply
foolish-indigo

columns accessors defined inside group gets wrong types

info.getValue() type resolves to
any
instead of correct type, if the accessor is defined in column group.
For example:
const colHelper = createColumnHelper<{name:string}>();

const columns = [
  colHelper.accessor("name", {
    cell: (info) => info.getValue() // <-- resolves to "string"
  })
]

const columnsWithGroup = [
  colHelper.group({
    columns: [
      colHelper.accessor("name", {
        cell: (info) => info.getValue(), // <-- resolves to "any"
      }),
    ],
  })
]


Related GH issues:
1. https://github.com/TanStack/table/issues/5065
2. https://github.com/TanStack/table/issues/5860

Does anybody knows workaround other that just using as ... ?
GitHub
Describe the bug If you use createColumnHelper<RowType>() to make a column helper, then make a group, then make accessor columns inside of that group; then the types of the TValue generic for...
GitHub
TanStack Table version 8.20.6 Framework/Library version React 19.0.0 Describe the bug and the steps to reproduce it When a column is created using the columnHelper.accessor() utility within a colum...
Was this page helpful?