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 0c4cd8b commit 91feaac
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/VirtualTable/VirtualRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,18 @@ export default function VirtualRow({
scrollLeft,
);

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

0 comments on commit 91feaac

Please sign in to comment.