Skip to content

Commit b4dc902

Browse files
checking for undefined in nextProps so we don't clear out the currentPage
1 parent aa8554c commit b4dc902

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

build/reactable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ window.ReactDOM["default"] = window.ReactDOM;
12501250
}, {
12511251
key: 'updateCurrentPage',
12521252
value: function updateCurrentPage(nextPage) {
1253-
if (nextPage !== this.state.currentPage) {
1253+
if (typeof nextPage !== 'undefined' && nextPage !== this.state.currentPage) {
12541254
this.setState({ currentPage: nextPage });
12551255
}
12561256
}

lib/reactable/table.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ var Table = (function (_React$Component) {
281281
}, {
282282
key: 'updateCurrentPage',
283283
value: function updateCurrentPage(nextPage) {
284-
if (nextPage !== this.state.currentPage) {
284+
if (typeof nextPage !== 'undefined' && nextPage !== this.state.currentPage) {
285285
this.setState({ currentPage: nextPage });
286286
}
287287
}

src/reactable/table.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export class Table extends React.Component {
240240
}
241241

242242
updateCurrentPage(nextPage) {
243-
if (nextPage !== this.state.currentPage) {
243+
if (typeof(nextPage) !== 'undefined' && nextPage !== this.state.currentPage) {
244244
this.setState({ currentPage: nextPage});
245245
}
246246
}

0 commit comments

Comments
 (0)