The error Animated useNativeDriver was not specified This is a required option and must be explicitly set to ‘true’ or ‘false’ comes when we would use Animated.timing() method to execute animation without useNativeDriver: true. The useNativeDriver: true prop passes all the information about animation to the UI(User Interface) thread. By passing all the information to the UI it will make the animation smoother and runs faster without itches. So in this tutorial we would solve the Yellow box warning Animated useNativeDriver was not specified This is a required option and must be explicitly set to ‘true’ or ‘false’ error in react native android iOS app.
Contents in this project Animated useNativeDriver was not specified This is a required option React Native Error Solution:
1. Before getting stared here is the screenshot of How this error looks like in mobile app.
2. To solve this error we have to add
useNativeDriver: true inside our
Animated.timing() method.
Sample code before adding useNativeDriver: true :-
1
2
3
4
|
Animated.timing(this.state.animatedValue, {
toValue: 1,
duration: 400,
}).start();
|
Sample code After adding useNativeDriver: true :-
1
2
3
4
5
|
Animated.timing(this.state.animatedValue, {
toValue: 1,
duration: 400,
useNativeDriver: true, // <– Add this Line
}).start();
|
Here you go guys, Now the error has been resolved . Hope you guys like my tutorial if you do like then please comment below .