Type of columns for reusable Table component
In v7, I have a reusable
<Table />
component that my various tables across my app use. I'd like to continue that pattern in v8, but it seems that the columns
prop cannot be typed correctly? There are a number of people looking for a solution in https://github.com/TanStack/table/issues/4382, is there any guidance to how to correctly type columns
? Does it need to be a generic so that it can be inferred, or something?1 Reply
passive-yellow•3y ago
Ian discovered that column helpers are the answer in react-table v8, cool impl!
https://tanstack.com/table/v8/docs/guide/column-defs#column-helpers
Columns | TanStack Table Docs
API
Table API