komarovalexander / ka-table

Lightweight MIT React Table component with Sorting, Filtering, Grouping, Virtualization, Editing and many more
http://ka-table.com
MIT License
787 stars 58 forks source link

Make ITableProps a generic #397

Closed komarovalexander closed 7 months ago

komarovalexander commented 7 months ago

PR adds ability to specify type for table data to avoid any in childComponents rowData and Table data

const data: TableDataItem[] = [];
<Table<TableDataItem> // define data item type
    data=[data] // data has TableDataItem[] type
    //...
    childComponents={{
        cellText: {
            content: (props) => {
               //.. props.rowData has type TableDataItem 
            }
        }
    }}
}}
.../>

343