How to set `key` for <th /> in <Table /> ?
See original GitHub issueWhat problem does this feature solve?
Normally, Antd sets auto-Increment number as key for <th />
. In most of the cases, it’s fine.
But, when the columns
changes frequently, this will cause some unnecessary unmount and mount.
Especially when I use a React component as some columns’ title.
What does the proposed API look like?
const columns = [];
// when set columns, it can use the key for `<th />`, not only `<td />`
columns.push({
title: <SomeComponent />,
dataIndex: 'name',
key: 'name'
});
return <Table columns={columns} />;
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
HTML th tag - W3Schools
The <th> tag defines a header cell in an HTML table. An HTML table has two kinds of cells: ... The text in...
Read more >Create key on a data.table — setkey • data.table - GitLab
setkey sorts a data.table and marks it as sorted with an attribute "sorted" . The sorted columns are the key. The key can...
Read more ><th>: The Table Header element - HTML - MDN Web Docs
The <th> HTML element defines a cell as header of a group of table cells. The exact nature of this group is defined...
Read more >Add a primary key to a table in Access - Microsoft Support
In the Navigation Pane, right click a table, and select Design View. Select the field or fields you want to use as the...
Read more >What is the purpose of setting a key in data.table?
setkey () sorts a data.table and marks it as sorted. The sorted columns are the key. The key can be any columns in...
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
Try
rc-table@6.1.4
, will usecolumn.key || column.dataIndex
as keyCan we use
column.key
forth
defaultly?