From 13d87cdf59512a29348890f1a57471095491d07b Mon Sep 17 00:00:00 2001 From: khanin_daniil Date: Mon, 25 Sep 2017 22:24:44 +0300 Subject: [PATCH 1/2] show bug --- packages/react-bootstrap-table2/src/row.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-bootstrap-table2/src/row.js b/packages/react-bootstrap-table2/src/row.js index ed7610268..46e92e6f5 100644 --- a/packages/react-bootstrap-table2/src/row.js +++ b/packages/react-bootstrap-table2/src/row.js @@ -22,6 +22,7 @@ const Row = (props) => { cidx: editingColIdx, ...rest } = cellEdit; + console.warn('DOUBLE_RENDER?'); return ( { From 2cf98375011222d394b867eb79bbc82e6a7565e1 Mon Sep 17 00:00:00 2001 From: khanin_daniil Date: Mon, 25 Sep 2017 22:27:16 +0300 Subject: [PATCH 2/2] double render fix bug --- packages/react-bootstrap-table2/src/bootstrap-table.js | 4 ++-- packages/react-bootstrap-table2/src/row.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-bootstrap-table2/src/bootstrap-table.js b/packages/react-bootstrap-table2/src/bootstrap-table.js index f93a30a26..52cf86b42 100644 --- a/packages/react-bootstrap-table2/src/bootstrap-table.js +++ b/packages/react-bootstrap-table2/src/bootstrap-table.js @@ -1,5 +1,5 @@ /* eslint arrow-body-style: 0 */ -import React, { Component } from 'react'; +import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import cs from 'classnames'; @@ -10,7 +10,7 @@ import PropsBaseResolver from './props-resolver'; import Const from './const'; import _ from './utils'; -class BootstrapTable extends PropsBaseResolver(Component) { +class BootstrapTable extends PropsBaseResolver(PureComponent) { constructor(props) { super(props); this.validateProps(); diff --git a/packages/react-bootstrap-table2/src/row.js b/packages/react-bootstrap-table2/src/row.js index 46e92e6f5..ed7610268 100644 --- a/packages/react-bootstrap-table2/src/row.js +++ b/packages/react-bootstrap-table2/src/row.js @@ -22,7 +22,6 @@ const Row = (props) => { cidx: editingColIdx, ...rest } = cellEdit; - console.warn('DOUBLE_RENDER?'); return ( {