Skip to content

Commit b3a76da

Browse files
committed
2 parents 0e8981c + f7faff9 commit b3a76da

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

docs/examples/fixedColumnsAndHeader.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,10 @@ const columns = [
6161
},
6262
];
6363

64-
const Demo = () => {
65-
return (
66-
<React.StrictMode>
67-
<div>
68-
<Table columns={columns as any} data={[]} scroll={{ x: 'max-content' }} sticky />
69-
</div>
70-
</React.StrictMode>
71-
);
72-
};
64+
const Demo = () => (
65+
<React.StrictMode>
66+
<Table columns={columns as any} data={[]} scroll={{ x: 'max-content' }} sticky />
67+
</React.StrictMode>
68+
);
7369

7470
export default Demo;

docs/examples/scrollXY.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const Demo = () => {
4444
</button>
4545
<div style={{ display: visible ? undefined : 'none' }}>
4646
<Table
47-
useFixedHeader
4847
style={{ width: 800 }}
4948
scroll={{ x: 1500, y: 300 }}
5049
columns={columns}

docs/examples/scrollY.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ class Demo extends React.Component {
4646
data={data}
4747
scroll={{ y: 300 }}
4848
rowKey={record => record.key}
49-
bodyStyle={{
50-
display: showBody ? '' : 'none',
51-
}}
49+
onRow={(record, index) => ({ style: { backgroundColor: "red" } })}
5250
/>
5351
);
5452
}

src/Body/BodyRow.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ function BodyRow<RecordType extends { children?: readonly RecordType[] }>(
8787
};
8888

8989
// =========================== onRow ===========================
90-
let additionalProps: React.HTMLAttributes<HTMLElement>;
91-
if (onRow) {
92-
additionalProps = onRow(record, index);
93-
}
90+
const additionalProps = onRow?.(record, index);
9491

9592
const onClick: React.MouseEventHandler<HTMLElement> = (event, ...args) => {
9693
if (expandRowByClick && mergedExpandable) {

0 commit comments

Comments
 (0)