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.Value resets if not rendered #23621

Closed
Elijen opened this issue Feb 24, 2019 · 3 comments
Closed

Animated.Value resets if not rendered #23621

Elijen opened this issue Feb 24, 2019 · 3 comments
Labels
API: Animated Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@Elijen
Copy link

Elijen commented Feb 24, 2019

🐛 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 to true.

To Reproduce

  1. Animate a Value
  2. Using state show/hide the Animated.View that is using the Value periodically
  3. Animated.Value will keep reseting

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

@CatapultJesse
Copy link

Could be related to: #23712

@Elijen
Copy link
Author

Elijen commented Mar 2, 2019

@CatapultJesse Yup, the same issue.

@kelset
Copy link
Contributor

kelset commented Mar 19, 2019

Duplicate of #23712

@kelset kelset marked this as a duplicate of #23712 Mar 19, 2019
@kelset kelset closed this as completed Mar 19, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Animated Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants