Merge pull request #488 from esteemapp/bugfix/#439

added render require for force render when data changed
This commit is contained in:
uğur erdal 2019-01-25 10:32:39 +03:00 committed by GitHub
commit f60a57af03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}
/>
<VotersDisplay key={Math.random()} votes={filterResult || data} />
{!isRenderRequire && <VotersDisplay key={Math.random()} votes={filterResult || data} />}
</View>
);
}