Skip to content

Commit 0a4e767

Browse files
authored
fix(virtual-table): make virtual use components props (#1036)
1 parent b0be0e3 commit 0a4e767

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.gitpod.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This configuration file was automatically generated by Gitpod.
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
3+
# and commit this file to your remote git repository to share the goodness with others.
4+
5+
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
6+
7+
tasks:
8+
- init: npm install && npm run compile
9+
command: npm run start
10+
11+

src/VirtualTable/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ export interface VirtualTableProps<RecordType> extends Omit<TableProps<RecordTyp
2424
}
2525

2626
function VirtualTable<RecordType>(props: VirtualTableProps<RecordType>, ref: React.Ref<Reference>) {
27-
const { columns, scroll, sticky, prefixCls = DEFAULT_PREFIX, className, listItemHeight } = props;
27+
const {
28+
columns,
29+
scroll,
30+
sticky,
31+
prefixCls = DEFAULT_PREFIX,
32+
className,
33+
listItemHeight,
34+
components,
35+
} = props;
2836

2937
let { x: scrollX, y: scrollY } = scroll || {};
3038

@@ -63,6 +71,7 @@ function VirtualTable<RecordType>(props: VirtualTableProps<RecordType>, ref: Rea
6371
x: scrollX,
6472
}}
6573
components={{
74+
...components,
6675
body: renderBody,
6776
}}
6877
columns={columns}

0 commit comments

Comments
 (0)