diff --git a/packages/react-bootstrap-table2/src/contexts/index.js b/packages/react-bootstrap-table2/src/contexts/index.js index 1df8d6c..1793dfb 100644 --- a/packages/react-bootstrap-table2/src/contexts/index.js +++ b/packages/react-bootstrap-table2/src/contexts/index.js @@ -91,6 +91,13 @@ const withContext = Base => this.PaginationContext = nextProps.pagination.createContext( this.isRemotePagination, this.handleRemotePageChange); } + if (!nextProps.cellEdit && this.props.cellEdit) { + this.CellEditContext = null; + } + if (nextProps.cellEdit && !this.props.cellEdit) { + this.CellEditContext = nextProps.cellEdit.createContext( + _, dataOperator, this.isRemoteCellEdit, this.handleRemoteCellChange); + } } renderBase() {