Skip to content

Commit 18caf0a

Browse files
committed
try to fix #1085 and #1098
1 parent 1b9bd63 commit 18caf0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-bootstrap-table2/src/store/selection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import _ from '../utils';
22
import { getRowByRowId } from './rows';
33

44
export const getSelectionSummary = (
5-
data,
5+
data = [],
66
keyField,
77
selected = []
88
) => {
@@ -24,7 +24,7 @@ export const getSelectionSummary = (
2424
};
2525
};
2626

27-
export const selectableKeys = (data, keyField, skips = []) => {
27+
export const selectableKeys = (data = [], keyField, skips = []) => {
2828
if (skips.length === 0) {
2929
return data.map(row => _.get(row, keyField));
3030
}
@@ -40,6 +40,6 @@ export const unSelectableKeys = (selected, skips = []) => {
4040
return selected.filter(x => _.contains(skips, x));
4141
};
4242

43-
export const getSelectedRows = (data, keyField, selected) =>
43+
export const getSelectedRows = (data = [], keyField, selected) =>
4444
selected.map(k => getRowByRowId(data, keyField, k)).filter(x => !!x);
4545

0 commit comments

Comments
 (0)