Open dannycochran opened 6 years ago
Same having problems with Animated and setTimeout, sometimes setTimeout fires early. Debuging using a Android phone.
React 16.0.0 RN 0.50.0
This seems to be specific to animated Text components, a viable workaround is to wrap the Text with an animated View.
Here’s the animation I’m using:
const loadingAnimation = Animated.sequence([
Animated.timing(loadingOpacity, {
toValue: 1,
duration: 200,
useNativeDriver: true
}),
Animated.timing(loadingTextOpacity, {
toValue: 1,
delay: 5000,
duration: 1000,
useNativeDriver: true
})
]);
Animated.sequence
nor Animated.parallel
work properly.delay
is set in Animated.timing
directly instead of Animated.delay
RN 0.55.4
Is there any update on this @lnikkila ?
I’m not a maintainer, unfortunately I don’t know when this is going to be fixed. Since it doesn’t result in a major loss of functionality and there’s a workaround it probably doesn’t have a very high priority. I’m sure pull requests are welcome though!
Also noticed this issue, and only for<Text/>
I have same problem
Same problem expo sdk 38 react rative 0.62
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This is still happening with the latest version. On Android it works as expected, but on iOS the animation doesn't happen.
On iOS, if attempting to animate a text component and a view component in parallel, preceded by an Animated.delay (or setTimeout), the text component will not animate:
If you remove "useNativeDriver" from the "textAnimation", the animation works. Also, making the textAnimation interpolate from viewAnimation does not work (that's how my code originally worked, but I broke them out into separate animations to test what was going wrong).
Environment
Environment: OS: macOS High Sierra 10.13.3 Node: 8.9.4 Yarn: 1.5.1 npm: 5.6.0 Watchman: Not Found Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0-alpha.3 react-native: 0.54.2 => 0.54.2
Steps to Reproduce
See code snippet above, alternatively you can check out my example repo:
Expected Behavior
The animations for both the View and Text component work, as they do on Android.
Actual Behavior
The text opacity never animates.