Animated.Value resets if not rendered #23621
Labels
API: Animated
Bug
Platform: iOS
iOS applications.
Resolution: Locked
This issue was locked by the bot.
馃悰 Bug Report
If render() method does not return an Animated.View that uses the Animated.Value we are animating the Animated.Value resets and will have a wrong value on the next render() call. This goes against the basic principle that render() method should be a pure function without side effects.
I suspect that this behavior also causes bugs/freezes when
shouldRasterizeIOS
set totrue
.To Reproduce
Expected Behavior
Animated.Value._value should not depend on the results of render() method
Code Example
https://snack.expo.io/@peller/animated.value-bug
Environment
React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Memory: 859.86 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.3.0 - ~/.nvm/versions/node/v8.3.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v8.3.0/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
Android SDK:
Build Tools: 26.0.1
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz => 0.57.1
The text was updated successfully, but these errors were encountered: