Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Commit 60fad89

Browse files
committed
Add prop checkEquals
1 parent 21f0552 commit 60fad89

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/MUIDataTable.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,17 @@ class MUIDataTable extends React.Component {
176176
}),
177177
/** Pass and use className to style MUIDataTable as desired */
178178
className: PropTypes.string,
179+
height: PropTypes.string,
180+
checkEquals: PropTypes.bool,
179181
};
180182

181183
static defaultProps = {
182184
title: '',
183185
options: {},
184186
data: [],
185187
columns: [],
188+
height: '',
189+
checkEquals: true,
186190
};
187191

188192
state = {
@@ -226,7 +230,10 @@ class MUIDataTable extends React.Component {
226230
}
227231

228232
componentWillReceiveProps(nextProps) {
229-
if (!equals(this.props.data, nextProps.data) || !equals(this.props.columns, nextProps.columns)) {
233+
if (
234+
!this.props.checkEquals ||
235+
(!equals(this.props.data, nextProps.data) || !equals(this.props.columns, nextProps.columns))
236+
) {
230237
this.initializeTable(nextProps);
231238
}
232239
}

0 commit comments

Comments
 (0)