[RFC] Deprecated Table columns.render return cell props and use `onCell` instead
See original GitHub issue📋 RFC
Summary
Use onCell
instead of render
return cell.props
.
Basic example
const columns = [{
dataIndex: 'name',
-- render: (val) => ({
-- props: { colSpan: 2 },
-- children: val,
-- });
++ onCell: (record) => ({ colSpan: 2 });
}];
Motivation
As #32979 mentioned. Table column mix props & node in one render
function which cost additional perf calculation. And this will also makes row hover calculation no way to optimize. Since we already have onCell
function and this is same logic as render.props
, it’s reasonable to de-duplicate.
Detailed
To make this RFC done:
- We need patch warning info in
rc-table
and suggest user move toonCell
. Also keep origin span logic do not modified. - Move hover logic to
onCell
base which will speed up render perf
Drawbacks
No break of current usage. But get warning.
Adoption strategy
When finished dev will replace all demo to new usage.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Cannot get Ant design Table cell to have reference to dynamic ...
I made some changes to your code and managed to achieve logging the correct number of columns on the button click for a...
Read more >Table - Ant Design
A table displays rows of data. When To Use. To display a collection of structured data. To sort, search, paginate, filter data. How...
Read more >Column onCell 'GetComponentProps<unknown>' error #22451
When trying to render a record onto a Column using the onCell method, this typescript error is encountered: Type '(record: unknown) => {...
Read more >show message validate error input once at a time ant design ...
Added column[onCell] to allow passing custom props to table body cell. ... Deprecate getBodyWrapper , please use components instead。
Read more >Apache HBase ™ Reference Guide
We will show you how to create a table in HBase using the hbase shell CLI, ... hbase(main):006:0> scan 'test' ROW COLUMN+CELL row1...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How to get
value
as parameter ofonCell
? As I understand onlyrecord
is passed inonCell
, for what would we needdataIndex
then?Seems like deprecating
render
while not fully support an alternative is not the best approach.I am asking this because table performance is still horrible, because of the hover issue.
Exactly! The
value
property is very useful, so i don’t think we will migrate toonCell
until you have a suitable substitute torender