From 19be67c9146167ea8955134011cbc31ac82c36e6 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sun, 14 Oct 2018 15:07:30 +0800 Subject: [PATCH] fix #599 --- packages/react-bootstrap-table2/src/contexts/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-bootstrap-table2/src/contexts/index.js b/packages/react-bootstrap-table2/src/contexts/index.js index 3011d6b..dc2f6a7 100644 --- a/packages/react-bootstrap-table2/src/contexts/index.js +++ b/packages/react-bootstrap-table2/src/contexts/index.js @@ -54,6 +54,16 @@ const withContext = Base => } } + componentWillReceiveProps(nextProps) { + if (!nextProps.pagination && this.props.pagination) { + this.PaginationContext = null; + } + if (nextProps.pagination && !this.props.pagination) { + this.PaginationContext = nextProps.pagination.createContext( + this.isRemotePagination, this.handleRemotePageChange); + } + } + renderBase() { return ( rootProps,