Skip to content

Commit

Permalink
chore: update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi committed Apr 29, 2024
1 parent 91feaac commit aa788a9
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/VirtualTable/VirtualRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,14 @@ export default function VirtualRow({
scrollLeft,
);

return showColumnIndexes.reduce(
(total, colIndex) =>
total.concat(
<VirtualCell
key={colIndex}
column={flattenColumns[colIndex]}
colIndex={colIndex}
style={startIndex === colIndex ? { marginLeft: virtualOffset } : {}}
cellProps={cellPropsCollections[colIndex]}
{...restProps}
/>,
),
[],
);
return showColumnIndexes.map(colIndex => (
<VirtualCell
key={colIndex}
column={flattenColumns[colIndex]}
colIndex={colIndex}
style={startIndex === colIndex ? { marginLeft: virtualOffset } : {}}
cellProps={cellPropsCollections[colIndex]}
{...restProps}
/>
));
}

0 comments on commit aa788a9

Please sign in to comment.