I'd like to propose this change:
Before:
export declare type DataIndex = string | number | (string | number)[];
After:
export declare type DataIndex<RecordType> = keyof RecordType | number | (keyof RecordType | number)[];
That way, you get full type checking on dataIndex like here:
const columns : ColumnsType<Client>= [
{
title: 'Name',
dataIndex: 'name', // If 'name' does not exist for type Client, a Typescript error will occur
key: 'name',
render: text => <a>{text}</a>
},
]
If you like it, I can send a PR.
I'd like to propose this change:
Before:
After:
That way, you get full type checking on
dataIndexlike here:If you like it, I can send a PR.