Skip to content

Commit

Permalink
deal with multiple setquery calls
Browse files Browse the repository at this point in the history
  • Loading branch information
hiagolcm committed Mar 1, 2021
1 parent 91d71fe commit 9f506f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion react/components/Slider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ export default class Slider extends Component {

const [prevLeftValue, prevRightValue] = prevProps.values || []
const [leftValue, rightValue] = this.props.values || []
const { left: leftState, right: rightState } = this.state.values

if (prevLeftValue !== leftValue || prevRightValue !== rightValue) {
if (
(prevLeftValue !== leftValue || prevRightValue !== rightValue) &&
(leftValue !== leftState || rightValue !== rightState)
) {
this.setState(
currentState => ({
...currentState,
Expand Down

0 comments on commit 9f506f0

Please sign in to comment.