Skip to content

Commit a84ceb1

Browse files
committed
fix an exception if table source data is immutable type
1 parent a0a173c commit a84ceb1

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/TableBody.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,19 @@ class TableBody extends Component {
169169
}
170170
return (result);
171171
}, this);
172+
173+
var tableRowsOutput = tableRows;
174+
172175
if (tableRows.length === 0 && !this.props.withoutNoDataText) {
173-
tableRows.push(
174-
<TableRow key='##table-empty##'>
175-
<td data-toggle='collapse'
176-
colSpan={ this.props.columns.length + (isSelectRowDefined ? 1 : 0) }
177-
className='react-bs-table-no-data'>
178-
{ this.props.noDataText || Const.NO_DATA_TEXT }
179-
</td>
180-
</TableRow>
176+
tableRowsOutput = [
177+
<TableRow key='##table-empty##'>
178+
<td data-toggle='collapse'
179+
colSpan={ this.props.columns.length + (isSelectRowDefined ? 1 : 0) }
180+
className='react-bs-table-no-data'>
181+
{ this.props.noDataText || Const.NO_DATA_TEXT }
182+
</td>
183+
</TableRow>
184+
]
181185
);
182186
}
183187

@@ -188,7 +192,7 @@ class TableBody extends Component {
188192
<table className={ tableClasses }>
189193
{ React.cloneElement(tableHeader, { ref: 'header' }) }
190194
<tbody ref='tbody'>
191-
{ tableRows }
195+
{ tableRowsOutput }
192196
</tbody>
193197
</table>
194198
</div>

0 commit comments

Comments
 (0)