From 4e223281a555dac889a96e533c4e10a5304121e3 Mon Sep 17 00:00:00 2001 From: u-e Date: Wed, 23 Jan 2019 13:57:20 +0300 Subject: [PATCH] added render require for force render when data changed --- src/screens/voters/screen/votersScreen.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/screens/voters/screen/votersScreen.js b/src/screens/voters/screen/votersScreen.js index 06258d568..745d494e6 100644 --- a/src/screens/voters/screen/votersScreen.js +++ b/src/screens/voters/screen/votersScreen.js @@ -24,6 +24,7 @@ class VotersScreen extends PureComponent { this.state = { data: props.votes, filterResult: null, + isRenderRequire: false, }; } @@ -48,7 +49,7 @@ class VotersScreen extends PureComponent { break; } - this.setState({ filterResult: _data }); + this.setState({ filterResult: _data, isRenderRequire: true }, () => this.setState({ isRenderRequire: false })); }; _handleRightIconPress = () => {}; @@ -67,7 +68,7 @@ class VotersScreen extends PureComponent { }; render() { - const { data, filterResult } = this.state; + const { data, filterResult, isRenderRequire } = this.state; const { intl } = this.props; const headerTitle = intl.formatMessage({ id: 'voters.voters_info', @@ -86,7 +87,7 @@ class VotersScreen extends PureComponent { defaultText="REWARDS" onDropdownSelect={this._handleOnDropdownSelect} /> - + {!isRenderRequire && } ); }