I would like to add a custom data-testid to a row in an antd table, but from the docs I don't see how you can hook into annotating the table row itself. Any ideas how this can be done?
I would like to add a custom data-testid to a row in an antd table, but from the docs I don't see how you can hook into annotating the table row itself. Any ideas how this can be done?
As an alternative, you can use the rowClassName property of the table to add a class to that particular row:
const classNameGenerator = (record, index) => {
if(record.id == 2) {
return "my-special-row";
}
return "";
};
<Table columns={columns} dataSource={data} rowClassName={classNameGenerator} />