Skip to content

Commit 977887f

Browse files
author
John
committed
fix lint error
1 parent 9cca4cb commit 977887f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ ReactDOM.render(
3535
<Table
3636
columns={columns}
3737
indentSize={30}
38-
rowStyle={(record, index, indent) => (index == 0 ? { backgroundColor: '#eee' } : null)}
38+
rowStyle={(record, i) => i === 0 ? { backgroundColor: '#eee' } : null}
3939
expandedRowRender={record => <p>extra: {record.a}</p>}
40-
expandedRowStyle={(record, index, indent) => (index == 0 ? { backgroundColor: '#f3f3f3' } : null)}
40+
expandedRowStyle={(record, i) => i === 0 ? { backgroundColor: '#f3f3f3' } : null}
4141
data={data}
4242
className="table"
4343
/>

src/Table.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export default class Table extends React.Component {
328328
expandedRowContent = expandedRowRender(record, i, indent);
329329
}
330330
const className = rowClassName(record, i, indent);
331-
const style = rowStyle(record, i, indent)
331+
const style = rowStyle(record, i, indent);
332332

333333
const onHoverProps = {};
334334
if (this.columnManager.isAnyColumnsFixed()) {
@@ -384,8 +384,10 @@ export default class Table extends React.Component {
384384
const subVisible = visible && isRowExpanded;
385385

386386
if (expandedRowContent && isRowExpanded) {
387+
const expRowClassName = expandedRowClassName(record, i, indent);
388+
const expRowStyle = expandedRowStyle(record, i, indent);
387389
rst.push(this.getExpandedRow(
388-
key, expandedRowContent, subVisible, expandedRowClassName(record, i, indent), expandedRowStyle(record, i, indent), fixed
390+
key, expandedRowContent, subVisible, expRowClassName, expRowStyle, fixed
389391
));
390392
}
391393
if (childrenColumn) {

0 commit comments

Comments
 (0)