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 doesn't work with vectors and "useNativeDriver" set to "true" #23767

Closed
jmcartlamy opened this issue Mar 5, 2019 · 13 comments
Closed
Labels
API: Animated Bug 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

@jmcartlamy
Copy link

jmcartlamy commented Mar 5, 2019

🐛 Bug Report

Hello, when I want to loop an animation (Animated.timing and Animated.loop) with vectors (Animated.ValueXY) and with option useNativeDriver set to true, the animation is performed only once and the loop doesn't work.

Work fine without option useNativeDriver (or set to false).

This issue concerns only Animated.ValueXY because the loop works perfectly with single values (Animated.Value)

It seems to me that it works in an older version of react-native (v0.56.0)

To Reproduce

  1. Initialize a state value with new Animated.ValueXY({ x: 0, y: 0 })
  2. Create an animation with Animated.timing
  3. Add a block Animated.View with styles and link it with the created animation
  4. Loop the animation with Animated.loop

Expected Behavior

Animation must loop when I use an Animated.loop with Animated.ValueXY({ x: 0, y: 0 })

Code Example

https://snack.expo.io/ryF7cRjUV

Environment

React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 46.48 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.8.0 - ~/.nvm/versions/node/v10.8.0/bin/node
      Yarn: 1.9.4 - ~/.nvm/versions/node/v10.8.0/bin/yarn
      npm: 6.2.0 - ~/.nvm/versions/node/v10.8.0/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 22, 23, 24, 25, 26, 27, 28
        Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
        System Images: android-22 | Android TV ARM EABI v7a, android-22 | Android TV Intel x86 Atom, android-22 | ARM EABI v7a, android-22 | Intel x86 Atom, android-22 | Intel x86 Atom_64, android-22 | Google APIs ARM EABI v7a, android-22 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-23 | Intel x86 Atom, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.0 AI-171.4408382
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.5 => 0.58.5 
    npmGlobalPackages:
      react-native-cli: 2.0.1
@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information API: Animated labels Mar 5, 2019
@jmcartlamy
Copy link
Author

Still doesn't work on the latest version react-native@0.59.0

@dulmandakh
Copy link
Contributor

@jmcartlamy what is your platform?

@gagangoku
Copy link

We are also facing the same issue. Loop is not working with useNativeDriver

@stale
Copy link

stale bot commented Aug 2, 2019

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 a "Discussion" or add it to the "Backlog" 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 Aug 2, 2019
@jmcartlamy
Copy link
Author

Still doesn't work on the latest version react-native@0.60.4

@dulmandakh iOS & Android

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 5, 2019
@tberman
Copy link

tberman commented Aug 11, 2019

I have a similar issue w/ re-used Animated.Value's when looping w/ the native driver. It appears that there is some bug with reseting the internal value when an animation is stopped. When looping manually (via the Animation.start callback) I have to reset the Animated.Value's value back to the original value, which I do not have to do if I am not using the native driver.

@MaybeSomeone
Copy link

same problem!! any update?

@hefekranz
Copy link

Just experienced the same on 0.59. Anything planed about this for 0.60^ ?

@AndreyPatseiko
Copy link

The same problem!!

@georgeMorales
Copy link

The same problem, usenativeDriver doesn't work loop
Expo sdk 35

@stale
Copy link

stale bot commented Apr 21, 2020

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 a "Discussion" or add it to the "Backlog" 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 Apr 21, 2020
@stale
Copy link

stale bot commented Apr 28, 2020

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 Apr 28, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Animated Bug 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

10 participants