Skip to content

Commit

Permalink
fix(web): drs breaking due to infinite props updates (#2190)
Browse files Browse the repository at this point in the history
* fix(web): drs breaking due to infinite props updates

* v3.43.9-alpha.1

* v3.43.9-alpha.2

* fix(web): sync reactivecore
  • Loading branch information
mohdashraf010897 authored Mar 14, 2023
1 parent 259626f commit fb274f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/reactivecore
22 changes: 18 additions & 4 deletions packages/web/src/components/range/DynamicRangeSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,14 @@ class DynamicRangeSlider extends Component {
this.setReact(this.props);
});

checkSomePropChange(this.props, prevProps, ['dataField', 'nestedField', 'aggregationSize'], () => {
this.updateRangeQueryOptions(this.props);
});
checkSomePropChange(
this.props,
prevProps,
['dataField', 'nestedField', 'aggregationSize'],
() => {
this.updateRangeQueryOptions(this.props);
},
);

checkSomePropChange(
this.props,
Expand Down Expand Up @@ -629,7 +634,12 @@ class DynamicRangeSlider extends Component {
}

render() {
if (!this.state.currentValue || !this.state.range || this.props.range.start === null) {
if (
!this.state.currentValue
|| !this.state.range
|| this.props.range === null
|| this.props.range.start === null
) {
return null;
}

Expand Down Expand Up @@ -785,6 +795,10 @@ const mapStateToProps = (state, props) => {
}
if (range) {
range = formatRange(range);
// eslint-disable-next-line no-restricted-globals
if (isNaN(range.start) && isNaN(range.end)) {
range = null;
}
}
return {
options,
Expand Down

0 comments on commit fb274f3

Please sign in to comment.