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,