mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 15:33:12 +09:00
Add typing to column render methods
The render method for columns in Antd Table take the three arguments value, record, index. If dataIndex is set then value is the property given by dataIndex in record, otherwise value and record is the same. Unfortunately only record has the proper type while value is the type any. Change usage of `render: value =>` to `render: (_, value) =>` to get proper typing for the render methods defined on columns.
This commit is contained in:
1 parent
e530bbc83a
commit
880216b775
9 files changed
+30
-30
No files matched your search
@@ -92,7 +92,7 @@ function StoragePage() {
|
||||
if (aName > bName) { return 1; }
|
||||
return 0;
|
||||
},
|
||||
render: item => {
|
||||
render: (_, item) => {
|
||||
let localeName = getLocaleName(item[0]);
|
||||
let hasMeta = itemMetadata.get(item[0]);
|
||||
|
||||
@@ -108,7 +108,7 @@ function StoragePage() {
|
||||
align: "right",
|
||||
defaultSortOrder: "descend",
|
||||
sorter: (a, b) => a[1] - b[1],
|
||||
render: item => numberFormat.format(item[1]),
|
||||
render: (_, item) => numberFormat.format(item[1]),
|
||||
},
|
||||
]}
|
||||
dataSource={filter ? storage.filter(filter) : storage}
|
||||
|
||||
Reference in new issue
Block a user