Skip to the page

Animations and gestures · core

The Animated API and useNativeDriver

Animated describes an animation as a graph of values; with useNativeDriver: true the whole graph is sent to native once before it starts and runs on the UI thread, so it stays smooth when JS is busy, but the classic native driver can only animate non-layout props such as transform and opacity.

The notes

What you must know

  • useNativeDriver is not on by default: if you leave it out it is false (with a warning). Always set it.
  • The native driver supports non-layout props (transform, opacity). width, height, top, margin and flex are layout props and are not supported by the classic native driver.
  • RN 0.85 added an experimental Shared Animation Backend (with Software Mansion, from 0.85.1 on the experimental channel) that powers Animated and Reanimated and lets the native driver animate layout props. It is not the default yet.
  • Animated.event with useNativeDriver: true works with direct events such as ScrollView onScroll, not with PanResponder.
  • A value can be driven by only one driver. Mixing JS-driven and native-driven animations on the same Animated.Value fails.
  • Defaults: timing lasts 500 ms with an ease-in-out curve; spring uses friction 7 and tension 40.
  • LayoutAnimation animates the next layout change natively (fire-and-forget, cannot be interrupted).
  • Animate images with transform: scale, not width/height.

The red pen

Common traps: mistake → fix

  • Mistake: "useNativeDriver: true works for every style"

    Fix: only non-layout props (unless you opt into the experimental backend).

  • Mistake: "The native driver is the default now"

    Fix: it still defaults to false.

  • Mistake: "PanResponder + Animated.event with the native driver"

    Fix: native Animated.event works only with direct events like onScroll.

Easy to hard

Questions interviewers ask, easy to hard

  1. Why does useNativeDriver: true make an animation smoother?
  2. Why could you not animate width with it, and what changed in 0.85?
  3. When would you still pick Animated over Reanimated?
  4. Fade a header as the list scrolls using Animated. Which props and why?

Practise

Practise with these questions

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview