Skip to content

Commit 91feaac

Browse files
committed
chore: update logic
1 parent 0c4cd8b commit 91feaac

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/VirtualTable/VirtualRow.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@ export default function VirtualRow({
3131
scrollLeft,
3232
);
3333

34-
return showColumnIndexes
35-
.map(idx => flattenColumns[idx])
36-
.map((column, idx) => {
37-
const colIndex = showColumnIndexes[idx];
38-
return (
34+
return showColumnIndexes.reduce(
35+
(total, colIndex) =>
36+
total.concat(
3937
<VirtualCell
4038
key={colIndex}
41-
column={column}
39+
column={flattenColumns[colIndex]}
4240
colIndex={colIndex}
4341
style={startIndex === colIndex ? { marginLeft: virtualOffset } : {}}
4442
cellProps={cellPropsCollections[colIndex]}
4543
{...restProps}
46-
/>
47-
);
48-
});
44+
/>,
45+
),
46+
[],
47+
);
4948
}

0 commit comments

Comments
 (0)