close

[Solved] Animated: `useNativeDriver` was not specified issue of ReactNativeBase Input

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Animated: useNativeDriver was not specified issue of ReactNativeBase Input in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How To Solve Animated: useNativeDriver was not specified issue of ReactNativeBase Input Error ?

  1. How To Solve Animated: useNativeDriver was not specified issue of ReactNativeBase Input Error?

    To Solve Animated: useNativeDriver was not specified issue of ReactNativeBase Input Error When using Animated.spring or any other Animation specify useNativeDriver: true of useNativeDriver: false.

  2. Animated: useNativeDriver was not specified issue of ReactNativeBase Input

    To Solve Animated: useNativeDriver was not specified issue of ReactNativeBase Input Error When using Animated.spring or any other Animation specify useNativeDriver: true of useNativeDriver: false.

Solution 1

Refer to Animated doc , with animation types or composition functions, for example, Animated.decay()Animated.timing()Animated.spring()Animated.parallel()Animated.sequence(), specify useNativeDriver .

Animated.timing(this.state.animatedValue, {
  toValue: 1,
  duration: 500,
  useNativeDriver: true, // Add this line
}).start();

Solution 2

Animated exports the following animatable components using the above wrapper:

  • Animated.Image
  • Animated.ScrollView
  • Animated.Text
  • Animated.View
  • Animated.FlatList
  • Animated.SectionList

When working with Animated.event() , add useNativeDriver: false/true to the animation config.

<Animated.ScrollView
  scrollEventThrottle={1}
  onScroll={Animated.event(
    [{ nativeEvent: { contentOffset: { y: this.state.animatedValue } } }],
    { useNativeDriver: true } // Add this line
  )}
>
  {content}
</Animated.ScrollView>

Solution 3

When using Animated.spring or any other Animation specify useNativeDriver: true of useNativeDriver: false.

Example:

Animated.spring(this.position, {
    toValue: { x: 0, y: 0 },
    useNativeDriver: true,
}).start();

The Animated.spring is being called in onPanResponderRelease function.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment