Animated.sequence doesn't work with useNativeDriver set to true
See original GitHub issueJust trying to create a spinner with multiple moving parts using Animated.loop, Animated.sequence, and Animated.timing. Works when useNativeDriver is set to false, but not true.
React Native version:
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Memory: 13.57 GB / 31.95 GB
Binaries:
Node: 12.4.0 - C:\Program Files\nodejs\node.EXE
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-25 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.6010548
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Steps To Reproduce
- Just run my code below,
Describe what you expected to happen:
Expected the sequence to be looped when it finishes.
Snack, code example, screenshot, or link to a repository:
const rotationChat = new Animated.Value(0);
const rotationLoading = new Animated.Value(0);
function Example() {
React.useEffect(() => {
Animated.loop(
Animated.sequence([
Animated.timing(rotationChat, {
toValue: 1,
duration: 2000,
useNativeDriver: true,
}),
Animated.timing(rotationLoading, {
toValue: 1,
duration: 2000,
useNativeDriver: true,
}),
]),
).start();
const interval = setInterval(() => console.log(rotationChat, rotationLoading), 200);
return () => clearInterval(interval);
}, [])
return null
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Animated: `useNativeDriver` was not specified issue of ...
It gives a warning message: Animated: useNativeDriver was not specified. This is a required option and must be explicitly set to true or...
Read more >How to Fix Animated: `useNativeDriver` was not specified ...
1- First solution for Animation and Animatable As the warning says, we need to specify the useNativeDriver option explicitly and set it to...
Read more >Animated - React Native
You can use the native driver by specifying useNativeDriver: true in your animation configuration. See the Animations guide to learn more.
Read more >Bug with Animated.Loop? : r/reactnative - Reddit
I'm enabling native driver and either not setting the “iterations” ... it appears to work fine on the web with useNativeDriver set to...
Read more >Animated: `useNativeDriver` was not specified issue of ...
Solution: As the warning says, we need to specify the useNativeDriver option explicitly and set it to true or false . 1- Animation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
I confirm that the situation is completely the same. React-Native v0.61.4