Skip to content

Commit 3157dbe

Browse files
committed
fix #210
1 parent d0d78ef commit 3157dbe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/BootstrapTable.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class BootstrapTable extends React.Component {
2626
})
2727
});
2828
} else {
29-
this.store = new TableDataStore(this.props.data);
29+
let copy = this.props.data.slice();
30+
this.store = new TableDataStore(copy);
3031
}
3132

3233
this.initTable(this.props);
@@ -117,7 +118,7 @@ class BootstrapTable extends React.Component {
117118
componentWillReceiveProps(nextProps) {
118119
this.initTable(nextProps);
119120
if (Array.isArray(nextProps.data)) {
120-
this.store.setData(nextProps.data);
121+
this.store.setData(nextProps.data.slice());
121122
let paginationDom = this.refs.pagination;
122123
let page = paginationDom && paginationDom.getCurrentPage() || nextProps.options.page || 1;
123124
let sizePerPage = paginationDom && paginationDom.getSizePerPage() || nextProps.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0];

0 commit comments

Comments
 (0)