Skip to content

Commit aa788a9

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

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/VirtualTable/VirtualRow.tsx

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

34-
return showColumnIndexes.reduce(
35-
(total, colIndex) =>
36-
total.concat(
37-
<VirtualCell
38-
key={colIndex}
39-
column={flattenColumns[colIndex]}
40-
colIndex={colIndex}
41-
style={startIndex === colIndex ? { marginLeft: virtualOffset } : {}}
42-
cellProps={cellPropsCollections[colIndex]}
43-
{...restProps}
44-
/>,
45-
),
46-
[],
47-
);
34+
return showColumnIndexes.map(colIndex => (
35+
<VirtualCell
36+
key={colIndex}
37+
column={flattenColumns[colIndex]}
38+
colIndex={colIndex}
39+
style={startIndex === colIndex ? { marginLeft: virtualOffset } : {}}
40+
cellProps={cellPropsCollections[colIndex]}
41+
{...restProps}
42+
/>
43+
));
4844
}

0 commit comments

Comments
 (0)