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

Animated.loop resets animatedValue #18028

Closed
macrozone opened this issue Feb 20, 2018 · 2 comments
Closed

Animated.loop resets animatedValue #18028

macrozone opened this issue Feb 20, 2018 · 2 comments
Labels
API: Animated Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@macrozone
Copy link

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

Environment:
OS: macOS High Sierra 10.13.3
Node: 8.9.4
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: ^16.2.0 => 16.2.0
react-native: 0.53.0 => 0.53.0

Steps to Reproduce

class extends React.Component<*, *> {
  state = {
    hoverOffset: new Animated.Value(0)
  }
  startHovering() {
    console.log('start hover')
    Animated.loop(
      Animated.sequence([
        Animated.timing(this.state.hoverOffset, {
          toValue: 1,
          duration: 1000,
          easing: Easing.sin
        }),
        Animated.timing(this.state.hoverOffset, {
          toValue: 0.5,
          duration: 1000,
          easing: Easing.sin
        })
      ])
    ).start()
  }
  
   componentDidMount() {
     this.startHovering()
     this.state.hoverOffset.addListener(v => console.log(v))
  }

Expected Behavior

animation should set hoverOffset from 0 to 1 and then loop between 0.5 and 1

Actual Behavior

animation goes from 0 to 1 then 0.5 and then back to 0 and repeats (0 --> 1 --> 0.5 --> 0 --> 1 --> 0.5)

@hramos hramos added the Animated label Mar 8, 2018
@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Animated labels Mar 18, 2018
@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. API: Animated labels Mar 18, 2018
@stale
Copy link

stale bot commented Jun 17, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 17, 2018
@stale
Copy link

stale bot commented Jul 17, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jul 17, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Animated Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants