Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop if value prop is set to 0 #22

Open
noah79 opened this issue Dec 15, 2020 · 0 comments
Open

Infinite loop if value prop is set to 0 #22

noah79 opened this issue Dec 15, 2020 · 0 comments

Comments

@noah79
Copy link

noah79 commented Dec 15, 2020

Offending code:

  updateValue = (anima) => {
    this.props.update(anima)
    const {animatedValue} = this.target
    this.setState({animatedValue})
  }

Should be:

  updateValue = (anima) => {
    this.props.update(anima)
    const {animatedValue} = this.target
    if (animatedValue !== this.state.animatedValue) {
      this.setState({animatedValue})
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant