Skip to content

Commit 2ce9595

Browse files
authored
refactor: Cell component with responsiveImmutable (#928)
* refactor: Cell use responseImmutable * chore: fix path * fix: value check children * fix: data passing * fix: hover logic * fix: origin cell render logic * test: fix test case * test: fix test case * test: more test case * chore: clean up
1 parent dcc9847 commit 2ce9595

File tree

9 files changed

+291
-272
lines changed

9 files changed

+291
-272
lines changed

docs/examples/simple.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { TableProps } from 'rc-table';
12
import Table from 'rc-table';
23
import React, { useState } from 'react';
34
import '../../assets/index.less';
@@ -17,11 +18,12 @@ const data = [
1718
const Demo = () => {
1819
const [count, setCount] = useState(0);
1920

20-
const columns = [
21+
const columns: TableProps<any>['columns'] = [
2122
{
2223
title: 'title',
2324
dataIndex: 'a',
2425
render: () => count,
26+
// shouldCellUpdate: () => false,
2527
},
2628
];
2729

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"dependencies": {
5555
"@babel/runtime": "^7.10.1",
56-
"@rc-component/context": "^1.0.0",
56+
"@rc-component/context": "^1.2.0",
5757
"classnames": "^2.2.5",
5858
"rc-resize-observer": "^1.1.0",
5959
"rc-util": "^5.27.1"

src/Body/BodyRow.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,7 @@ function BodyRow<RecordType extends { children?: readonly RecordType[] }>(
8585
const [expandRended, setExpandRended] = React.useState(false);
8686

8787
if (process.env.NODE_ENV !== 'production') {
88-
devRenderTimes({
89-
prefixCls,
90-
fixedInfoList,
91-
flattenColumns,
92-
expandableType,
93-
expandRowByClick,
94-
onTriggerExpand,
95-
rowClassName,
96-
expandedRowClassName,
97-
indentSize,
98-
expandIcon,
99-
expandedRowRender,
100-
expandIconColumnIndex,
101-
});
88+
devRenderTimes(props);
10289
}
10390

10491
const expanded = expandedKeys && expandedKeys.has(rowKey);

0 commit comments

Comments
 (0)