useNativeDriver: Offload Animations from the JS Thread
useNativeDriver offloads animations from the JavaScript thread to the native UI thread for smoother performance. Use it in Animated API calls to prevent dropped frames.
Why it exists
React Native applications have two main threads: the JavaScript thread that runs your app logic, and the native UI thread that handles rendering. If the JS thread is busy with calculations or API calls, it can't send UI updates every frame, causing animations to stutter and feel janky. useNativeDriver was created to solve this bottleneck.
The mental model
Imagine a restaurant with a manager (the JS thread) and a chef (the native UI thread). Without useNativeDriver, the manager tells the chef every single step of a recipe, frame by frame: "add salt... now stir... now wait 16ms... now add pepper." If a customer interrupts the manager, cooking stops. With useNativeDriver, the manager gives the chef the entire recipe upfront ("fade this view in over 500ms") and the chef executes it perfectly without further interruption.
How it works
When you set useNativeDriver: true, the Animated API serializes the entire animation configuration—what to animate, its duration, and its easing curve—and sends it over the React Native bridge to the native side just once. The native UI thread then takes over and runs the entire animation from start to finish, completely independent of the JavaScript thread. This means even if the JS thread is blocked, your animation remains buttery smooth.
When to use it
Almost always for any animation using the Animated library. It's a simple boolean flag that provides a significant performance boost. It is especially critical for animations that run alongside other JS-heavy tasks, like fetching data or processing user input, as it ensures a fluid user experience regardless of background activity.
When not to use it
The primary limitation is that the native driver can only animate properties that don't affect the layout of components on screen. This includes transform properties (translateX, translateY, scale, rotate) and opacity. You cannot use the native driver to animate layout properties like width, height, margin, padding, top, or left. Attempting to do so will throw an error. For those cases, you must omit the property or set useNativeDriver: false.
One canonical example
Fading in a view is a classic use case. Without the native driver, a busy JS thread could make the fade appear choppy. With useNativeDriver: true, the fade is guaranteed to be smooth. The code Animated.timing(fadeAnim, { toValue: 1, duration: 500, useNativeDriver: true }).start(); tells the native code to handle animating a component's opacity to 1 over 500 milliseconds, freeing the JS thread entirely.
Interview question
Which animation property cannot be directly controlled by useNativeDriver: true in React Native?
- a.opacity
- b.heightCorrect
- c.translateX
- d.rotate
Why? this is the answer
The card states that useNativeDriver cannot animate properties that affect layout, such as 'height'. It is limited to 'transform' properties (like 'translateX' and 'rotate') and 'opacity'.
Just read this? Test yourself on what you have been reading.
Read the original → reactnative.dev
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on react-native — each one lists the topics its interview covers.
See open roles