Skip to content

Animated.loop doesn't work with vectors and "useNativeDriver" set to "true" #23767

@jmcartlamy

Description

@jmcartlamy

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: AnimatedBugRan CommandsOne of our bots successfully processed a command.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions