diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..49d515ed9
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,24 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: AllenFang
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is. In addition, please search issues before you open a report to make sure there's no any duplicated report
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**codesandbox**
+Please give a simple and minimal example on https://codesandbox.io so that we can reproduce it easily and handle it effectively
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..9ab483b61
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,23 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: AllenFang
+
+---
+
+**Is this feature requested before?**
+Please search issues to make sure to create feature which is never report yet.
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/i-have-a-question.md b/.github/ISSUE_TEMPLATE/i-have-a-question.md
new file mode 100644
index 000000000..d05d43578
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/i-have-a-question.md
@@ -0,0 +1,17 @@
+---
+name: I have a question
+about: I have a question
+title: ''
+labels: ''
+assignees: AllenFang
+
+---
+
+**Question**
+A clear and concise description of you question. In addition, please search issues before you open a question to make sure there's no any duplicated questions.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**codesandbox**
+Please give a simple and minimal example on https://codesandbox.io so that we can reproduce it easily.
diff --git a/README.md b/README.md
index ca053501d..290d5ee78 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# react-bootstrap-table2
[](https://travis-ci.org/react-bootstrap-table/react-bootstrap-table2)
-Rebuilt of [react-bootstrap-table](https://github.com/AllenFang/react-bootstrap-table)
+Rebuild of [react-bootstrap-table](https://github.com/AllenFang/react-bootstrap-table)
> Note that `react-bootstrap-table2`'s npm module name is [**`react-bootstrap-table-next`**](https://www.npmjs.com/package/react-bootstrap-table-next) due to the name being already taken.
diff --git a/docs/README.md b/docs/README.md
index dc12d3aeb..9bc4ff181 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -21,6 +21,7 @@
* [classes](#classes)
* [wrapperClasses](#wrapperClasses)
* [headerClasses](#headerClasses)
+* [headerWrapperClasses](#headerWrapperClasses)
* [cellEdit](#cellEdit)
* [selectRow](#selectRow)
* [expandRow](#expandRow)
@@ -28,19 +29,46 @@
* [rowClasses](#rowClasses)
* [rowEvents](#rowEvents)
* [hiddenRows](#hiddenRows)
+* [sort](#sort)
* [defaultSorted](#defaultSorted)
* [defaultSortDirection](#defaultSortDirection)
* [pagination](#pagination)
* [filter](#filter)
+* [filterPosition](filterPosition)
* [onTableChange](#onTableChange)
* [onDataSizeChange](#onDataSizeChange)
### keyField(**required**) - [String]
-Tells `react-bootstrap-table2` which column is unique.
+Tells `react-bootstrap-table2` which column of the data is unique. This should be the name of a property that is unique for each item in your dataset
### data(**required**) - [Array]
Provides data for your table. It accepts a single Array object.
+Each item in this array is an object that represents a row in the table. Each "Row" object should have a key-value pair for each column in the table, whose key matches that column's dataField value.
+
+For example, if your column definitions look like:
+
+```js
+columns = [
+ { dataField: 'id', text: 'Id' },
+ { dataField: 'name', text: 'Name' },
+ { dataField: 'animal', text: 'Animal' },
+]
+```
+
+Then your data might look like:
+
+```js
+data = [
+ { id: 1, name: 'George', animal: 'Monkey' }
+ { id: 2, name: 'Jeffrey', animal: 'Giraffe' }
+ { id: 3, name: 'Alice', animal: 'Giraffe' }
+ { id: 4, name: 'Alice', animal: 'Tiger' }
+]
+```
+
+And your "keyField" would be `id`
+
### columns(**required**) - [Object]
Accepts a single Array object, please see [columns definition](./columns.md) for more detail.
@@ -98,7 +126,14 @@ import overlayFactory from 'react-bootstrap-table2-overlay';
Actually, `react-bootstrap-table-overlay` is depends on [`react-loading-overlay`](https://github.com/derrickpelletier/react-loading-overlay) and `overlayFactory` just a factory function and you can pass any props which available for `react-loading-overlay`:
```js
-overlay={ overlayFactory({ spinner: true, background: 'rgba(192,192,192,0.3)' }) }
+overlay={
+ overlayFactory({
+ spinner: true,
+ styles: {
+ overlay: (base) => ({...base, background: 'rgba(255, 0, 0, 0.5)'})
+ }
+ })
+}
```
### caption - [String | Node]
@@ -128,6 +163,9 @@ Customize class on the outer element which wrap up the `table` element.
### headerClasses - [String]
Customize class on the header row(`tr`).
+### headerWrapperClasses - [String]
+Customize class on the `thead`.
+
### cellEdit - [Object]
Makes table cells editable, please see [cellEdit definition](./cell-edit.md) for more detail.
@@ -191,6 +229,27 @@ const hiddenRows = [1, 4];
```
+### sort - [Object]
+Two cases you probably need to configure `sort` prop:
+
+#### Manage sorting state
+You can give `dataField` and `order` to specify the sorting state in table, For example
+
+```js
+
+```
+
+#### One-time sorting configuration
+In earily version, we only can configure [`sortCaret`](./columns.md#sortCaret) and [`sortFunc` ](./columns.md#sortFunc) per column. But they are same in most of cases.
+So here we give you a chance to just setup these prop in one time.
+
+```js
+
+```
+
### defaultSorted - [Array]
`defaultSorted` accept an object array which allow you to define the default sort columns when first render.
@@ -201,6 +260,8 @@ const defaultSorted = [{
}];
```
+**Note**: Only the first column is sorted currently, see #1083.
+
### defaultSortDirection - [String]
Default sort direction when user click on header column at first time, available value is `asc` and `desc`. Default is `desc`.
@@ -320,6 +381,9 @@ Following is a shape of `newState`
}
```
+### filterPosition - [String]
+Available value is `inline`, `top` and `bottom`, default is `inline`. This prop decide where `react-bootstrap-table` render column filter.
+
### onDataSizeChange - [Function]
This callback function will be called only when data size change by search/filter etc. This function have one argument which is an object contains below props:
@@ -334,4 +398,4 @@ handleDataChange = ({ dataSize }) => {
onDataSizeChange={ handleDataChange }
....
/>
-```
\ No newline at end of file
+```
diff --git a/docs/columns.md b/docs/columns.md
index 55a4003e6..1749b8916 100644
--- a/docs/columns.md
+++ b/docs/columns.md
@@ -11,7 +11,9 @@ Available properties in a column object:
* [hidden](#hidden)
* [formatter](#formatter)
* [formatExtraData](#formatExtraData)
+* [type](#type)
* [sort](#sort)
+* [sortValue](#sortValue)
* [sortFunc](#sortFunc)
* [sortCaret](#sortCaret)
* [onSort](#onSort)
@@ -48,6 +50,7 @@ Available properties in a column object:
* [editorRenderer](#editorRenderer)
* [filter](#filter)
* [filterValue](#filterValue)
+* [searchable](#searchable)
* [csvType](#csvType)
* [csvFormatter](#csvFormatter)
* [csvText](#csvText)
@@ -132,11 +135,49 @@ The third argument: `components` have following specified properties:
## column.formatExtraData - [Any]
It's only used for [`column.formatter`](#formatter), you can define any value for it and will be passed as fourth argument for [`column.formatter`](#formatter) callback function.
+## column.type - [String]
+Specify the data type on column. Available value so far is `string`, `number`, `bool` and `date`. Default is `string`.
+`column.type` can be used when you enable the cell editing and want to save your cell data with correct data type.
+
## column.sort - [Bool]
Enable the column sort via a `true` value given.
+## column.sortValue - [Function]
+`column.sortValue` only work when `column.sort` enabled. This prop allow you to replace the value when table sorting.
+
+For example, consider following data:
+
+```js
+const types = ['Cloud Service', 'Message Service', 'Add Service', 'Edit Service', 'Money'];
+const data = [{id: 1, type: 2}, {id: 2, type: 1}, {id: 3, type:0}];
+const columns = [{
+ dataField: 'id',
+ text: 'Job ID'
+}, {
+ dataField: 'type',
+ text: 'Job Type'
+ sort: true,
+ formatter: (cell, row) => types[cell]
+}]
+```
+
+In above case, when user try to sort Job Type column which will sort the original value: 0, 1, 2 but we display the type name via [`column.formatter`](#formatter), which will lead confuse because we are sorting by type value instead of type name. So `sortValue` is a way for you to decide what kind of value should be adopted when sorting on a specify column:
+
+```js
+const columns = [{
+ dataField: 'id',
+ text: 'Job ID'
+}, {
+ dataField: 'type',
+ text: 'Job Type'
+ sort: true,
+ formatter: (cell, row) => types[cell],
+ sortValue: (cell, row) => types[cell] // we use type name to sort.
+}]
+```
+
## column.sortFunc - [Function]
-`column.sortFunc` only work when `column.sort` is enable. `sortFunc` allow you to define your sorting algorithm. This callback function accept six arguments:
+`column.sortFunc` only work when `column.sort` enabled. `sortFunc` allow you to define your sorting algorithm. This callback function accept six arguments:
```js
{
@@ -396,6 +437,7 @@ You can assign any [HTML Event](https://www.w3schools.com/tags/ref_eventattribut
* onMouseEnter
* onMouseLeave
* onContextMenu
+* onAuxClick
```js
{
@@ -415,7 +457,7 @@ If the events is not listed above, the callback function will only pass the `eve
{
// omit...
headerEvents: {
- onClick: e => { ... }
+ onClick: (e, column, columnIndex) => { ... }
}
}
```
@@ -553,6 +595,7 @@ This prop also accept a function:
* `column`
* `columnIndex`
+* `props`: It's an object and contain `text` property only.
## column.footerClasses - [String | Function]
It's similar to [`column.classes`](#classes), `footerClasses` is available to have customized class on table footer column:
@@ -625,7 +668,7 @@ It's also available to custom via a callback function:
{
// omit...
footerEvents: {
- onClick: e => { ... }
+ onClick: (e, column, columnIndex) => { ... }
}
}
```
@@ -912,6 +955,9 @@ A final `String` value you want to be filtered.
}
```
+## column.searchable - [Boolean]
+Default the column is searchable. Give `false` to disable search functionality on specified column.
+
## column.csvType - [Object]
Default is `String`. Currently, the available value is `String` and `Number`. If `Number` assigned, the cell value will not wrapped with double quote.
diff --git a/docs/row-expand.md b/docs/row-expand.md
index 08198fad7..a4b49d528 100644
--- a/docs/row-expand.md
+++ b/docs/row-expand.md
@@ -18,6 +18,8 @@
* [expandColumnPosition](#expandColumnPosition)
* [expandColumnRenderer](#expandColumnRenderer)
* [expandHeaderColumnRenderer](#expandHeaderColumnRenderer)
+* [className](#className)
+* [parentClassName](#parentClassName)
### expandRow.renderer - [Function]
@@ -25,12 +27,13 @@ Specify the content of expand row, `react-bootstrap-table2` will pass a row obje
#### values
* **row**
+* **rowIndex**
#### examples
```js
const expandRow = {
- renderer: row => (
+ renderer: (row, rowIndex) => (
{ `This Expand row is belong to rowKey ${row.id}` }
You can render anything here, also you can add additional data on every row object
@@ -165,3 +168,45 @@ const expandRow = {
expandColumnPosition: 'right'
};
```
+
+### expandRow.className - [String | Function]
+Apply the custom class name on the expanding row. For example:
+
+```js
+const expandRow = {
+ renderer: (row) => ...,
+ className: 'foo'
+};
+```
+following usage is more flexible way for customing the class name:
+
+```js
+const expandRow = {
+ renderer: (row) => ...,
+ className: (isExpanded, row, rowIndex) => {
+ if (rowIndex > 2) return 'foo';
+ return 'bar';
+ }
+};
+```
+
+### expandRow.parentClassName - [String | Function]
+Apply the custom class name on parent row of expanded row. For example:
+
+```js
+const expandRow = {
+ renderer: (row) => ...,
+ parentClassName: 'foo'
+};
+```
+Below case is more flexible way to custom the class name:
+
+```js
+const expandRow = {
+ renderer: (row) => ...,
+ parentClassName: (isExpanded, row, rowIndex) => {
+ if (rowIndex > 2) return 'foo';
+ return 'bar';
+ }
+};
+```
\ No newline at end of file
diff --git a/docs/row-selection.md b/docs/row-selection.md
index af2d16a5f..dce1f9f07 100644
--- a/docs/row-selection.md
+++ b/docs/row-selection.md
@@ -1,6 +1,6 @@
# Row selection
-`react-bootstrap-table2` supports the row selection feature. By passing prop `selectRow` to enable row selection. When you enable this feature, `react-bootstrap-table2` will prepend a new selection column.
+`react-bootstrap-table2` supports the row selection feature. By passing prop `selectRow` to enable row selection. When you enable this feature, `react-bootstrap-table2` will prepend a new selection column.
## Required
* [mode (**required**)](#mode)
@@ -11,6 +11,8 @@
* [classes)](#classes)
* [bgColor](#bgColor)
* [nonSelectable)](#nonSelectable)
+* [nonSelectableStyle](#nonSelectableStyle)
+* [nonSelectableClasses](#nonSelectableClasses)
* [clickToSelect)](#clickToSelect)
* [clickToExpand)](#clickToExpand)
* [clickToEdit](#clickToEdit)
@@ -139,6 +141,54 @@ const selectRow = {
};
```
+### selectRow.nonSelectableStyle - [Object | Function]
+This prop allow you to customize the non selectable rows. `selectRow.nonSelectableStyle` accepts an style object
+and a callback function for more flexible customization.
+
+### Style Object
+
+```js
+const selectRow = {
+ mode: 'checkbox',
+ nonSelectable: [1, 3 ,5],
+ nonSelectableStyle: { backgroundColor: 'gray' }
+};
+```
+
+### Callback Function
+
+```js
+const selectRow = {
+ mode: 'checkbox',
+ nonSelectable: [1, 3 ,5],
+ nonSelectableStyle: (row, rowIndex) => { return ...; }
+};
+```
+
+### selectRow.nonSelectableClasses - [String | Function]
+This prop allow you to set a custom class for the non selectable rows, or use a callback function for more
+flexible customization
+
+### String
+
+```js
+const selectRow = {
+ mode: 'checkbox',
+ nonSelectable: [1, 3 ,5],
+ nonSelectableClasses: 'my-class'
+};
+```
+
+### Callback Function
+
+```js
+const selectRow = {
+ mode: 'checkbox',
+ nonSelectable: [1, 3 ,5],
+ nonSelectableClasses: (row, rowIndex) => { return ...; }
+};
+```
+
### selectRow.clickToSelect - [Bool]
Allow user to select row by clicking on the row.
@@ -149,7 +199,7 @@ const selectRow = {
};
```
-> Note: When you also enable [cellEdit](./cell-edit.md), the `selectRow.clickToSelect` will deactivate the functionality of cell editing
+> Note: When you also enable [cellEdit](./cell-edit.md), the `selectRow.clickToSelect` will deactivate the functionality of cell editing
> If you want to click on row to select row and edit cell simultaneously, you are suppose to enable [`selectRow.clickToEdit`](#clickToEdit)
### selectRow.clickToExpand - [Bool]
@@ -307,7 +357,7 @@ const selectRow = {
mode: 'checkbox',
onSelectAll: (isSelect, rows, e) => {
if (isSelect && SOME_CONDITION) {
- return [1, 3, 4]; // finally, key 1, 3, 4 will being selected
+ return [1, 3, 4]; // finally, key 1, 3, 4 will being selected
}
}
};
diff --git a/package.json b/package.json
index 37859fdbd..2f5a73525 100644
--- a/package.json
+++ b/package.json
@@ -80,7 +80,7 @@
"webpack-dev-server": "2.7.1"
},
"dependencies": {
- "classnames": "2.2.5",
+ "classnames": "^2.2.5",
"prop-types": "15.5.10",
"react": "16.4.0",
"react-dom": "16.4.0",
diff --git a/packages/react-bootstrap-table2-editor/README.md b/packages/react-bootstrap-table2-editor/README.md
index b4e6b99aa..cda2e0a59 100644
--- a/packages/react-bootstrap-table2-editor/README.md
+++ b/packages/react-bootstrap-table2-editor/README.md
@@ -140,7 +140,7 @@ const columns = [
text: 'Job Type',
editor: {
type: Type.SELECT,
- getOptions: () => [.....]
+ getOptions: (setOptions, { row, column }) => [.....]
}
}];
@@ -152,7 +152,7 @@ const columns = [
text: 'Job Type',
editor: {
type: Type.SELECT,
- getOptions: (setOptions) => {
+ getOptions: (setOptions, { row, column }) => {
setTimeout(() => setOptions([...]), 1500);
}
}
diff --git a/packages/react-bootstrap-table2-editor/package.json b/packages/react-bootstrap-table2-editor/package.json
index b8171170b..8eb8e1460 100644
--- a/packages/react-bootstrap-table2-editor/package.json
+++ b/packages/react-bootstrap-table2-editor/package.json
@@ -1,6 +1,6 @@
{
"name": "react-bootstrap-table2-editor",
- "version": "1.2.4",
+ "version": "1.4.0",
"description": "it's the editor addon for react-bootstrap-table2",
"main": "./lib/index.js",
"scripts": {
diff --git a/packages/react-bootstrap-table2-editor/src/context.js b/packages/react-bootstrap-table2-editor/src/context.js
index e9317e2f1..30f5e6ae0 100644
--- a/packages/react-bootstrap-table2-editor/src/context.js
+++ b/packages/react-bootstrap-table2-editor/src/context.js
@@ -1,5 +1,8 @@
+/* eslint disable-next-line: 0 */
/* eslint react/prop-types: 0 */
/* eslint react/require-default-props: 0 */
+/* eslint camelcase: 0 */
+/* eslint react/no-unused-prop-types: 0 */
import React from 'react';
import PropTypes from 'prop-types';
import { CLICK_TO_CELL_EDIT, DBCLICK_TO_CELL_EDIT } from './const';
@@ -43,7 +46,7 @@ export default (
};
}
- componentWillReceiveProps(nextProps) {
+ UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.cellEdit && isRemoteCellEdit()) {
if (nextProps.cellEdit.options.errorMessage) {
this.setState(() => ({
@@ -56,12 +59,13 @@ export default (
}
handleCellUpdate(row, column, newValue) {
+ const newValueWithType = dataOperator.typeConvert(column.type, newValue);
const { cellEdit } = this.props;
const { beforeSaveCell } = cellEdit.options;
const oldValue = _.get(row, column.dataField);
const beforeSaveCellDone = (result = true) => {
if (result) {
- this.doUpdate(row, column, newValue);
+ this.doUpdate(row, column, newValueWithType);
} else {
this.escapeEditing();
}
@@ -69,7 +73,7 @@ export default (
if (_.isFunction(beforeSaveCell)) {
const result = beforeSaveCell(
oldValue,
- newValue,
+ newValueWithType,
row,
column,
beforeSaveCellDone
@@ -78,7 +82,7 @@ export default (
return;
}
}
- this.doUpdate(row, column, newValue);
+ this.doUpdate(row, column, newValueWithType);
}
doUpdate(row, column, newValue) {
diff --git a/packages/react-bootstrap-table2-editor/src/dropdown-editor.js b/packages/react-bootstrap-table2-editor/src/dropdown-editor.js
index a54bc4d62..b019e2ea6 100644
--- a/packages/react-bootstrap-table2-editor/src/dropdown-editor.js
+++ b/packages/react-bootstrap-table2-editor/src/dropdown-editor.js
@@ -8,7 +8,13 @@ class DropDownEditor extends Component {
super(props);
let options = props.options;
if (props.getOptions) {
- options = props.getOptions(this.setOptions.bind(this)) || [];
+ options = props.getOptions(
+ this.setOptions.bind(this),
+ {
+ row: props.row,
+ column: props.column
+ }
+ ) || [];
}
this.state = { options };
}
@@ -54,6 +60,8 @@ class DropDownEditor extends Component {
}
DropDownEditor.propTypes = {
+ row: PropTypes.object.isRequired,
+ column: PropTypes.object.isRequired,
defaultValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
diff --git a/packages/react-bootstrap-table2-editor/src/editing-cell.js b/packages/react-bootstrap-table2-editor/src/editing-cell.js
index 7c693b127..e72999852 100644
--- a/packages/react-bootstrap-table2-editor/src/editing-cell.js
+++ b/packages/react-bootstrap-table2-editor/src/editing-cell.js
@@ -2,6 +2,7 @@
/* eslint no-return-assign: 0 */
/* eslint class-methods-use-this: 0 */
/* eslint jsx-a11y/no-noninteractive-element-interactions: 0 */
+/* eslint camelcase: 0 */
import React, { Component } from 'react';
import cs from 'classnames';
import PropTypes from 'prop-types';
@@ -51,7 +52,11 @@ export default (_, onStartEdit) =>
};
}
- componentWillReceiveProps({ message }) {
+ componentWillUnmount() {
+ this.clearTimer();
+ }
+
+ UNSAFE_componentWillReceiveProps({ message }) {
if (_.isDefined(message)) {
this.createTimer();
this.setState(() => ({
@@ -60,10 +65,6 @@ export default (_, onStartEdit) =>
}
}
- componentWillUnmount() {
- this.clearTimer();
- }
-
clearTimer() {
if (this.indicatorTimer) {
clearTimeout(this.indicatorTimer);
@@ -201,7 +202,7 @@ export default (_, onStartEdit) =>
if (_.isFunction(column.editorRenderer)) {
editor = column.editorRenderer(editorProps, value, row, column, rowIndex, columnIndex);
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.SELECT) {
- editor = ;
+ editor = ;
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.TEXTAREA) {
editor = ;
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.CHECKBOX) {
diff --git a/packages/react-bootstrap-table2-editor/test/context.test.js b/packages/react-bootstrap-table2-editor/test/context.test.js
index 57b56bfd9..65e9d2ced 100644
--- a/packages/react-bootstrap-table2-editor/test/context.test.js
+++ b/packages/react-bootstrap-table2-editor/test/context.test.js
@@ -117,7 +117,7 @@ describe('CellEditContext', () => {
wrapper = shallow(shallowContext());
wrapper.setState(initialState);
wrapper.render();
- wrapper.instance().componentWillReceiveProps({});
+ wrapper.instance().UNSAFE_componentWillReceiveProps({});
});
it('should not set state.message', () => {
@@ -138,7 +138,7 @@ describe('CellEditContext', () => {
wrapper = shallow(shallowContext());
wrapper.setState(initialState);
wrapper.render();
- wrapper.instance().componentWillReceiveProps({
+ wrapper.instance().UNSAFE_componentWillReceiveProps({
cellEdit: cellEditFactory(defaultCellEdit)
});
});
@@ -164,7 +164,7 @@ describe('CellEditContext', () => {
wrapper = shallow(shallowContext(defaultCellEdit, true));
wrapper.setState(initialState);
wrapper.render();
- wrapper.instance().componentWillReceiveProps({
+ wrapper.instance().UNSAFE_componentWillReceiveProps({
cellEdit: cellEditFactory({
...defaultCellEdit,
errorMessage: message
@@ -190,7 +190,7 @@ describe('CellEditContext', () => {
beforeEach(() => {
wrapper = shallow(shallowContext(defaultCellEdit, true));
wrapper.setState(initialState);
- wrapper.instance().componentWillReceiveProps({
+ wrapper.instance().UNSAFE_componentWillReceiveProps({
cellEdit: cellEditFactory({ ...defaultCellEdit })
});
wrapper.update();
diff --git a/packages/react-bootstrap-table2-example/examples/basic/customized-id-classes.js b/packages/react-bootstrap-table2-example/examples/basic/customized-id-classes.js
index fae4bf723..63ec718d9 100644
--- a/packages/react-bootstrap-table2-example/examples/basic/customized-id-classes.js
+++ b/packages/react-bootstrap-table2-example/examples/basic/customized-id-classes.js
@@ -33,6 +33,8 @@ const columns = [{
+
+
`;
@@ -44,6 +46,12 @@ export default () => (