Skip to the page

Animations and gestures · senior

Gestures with React Native Gesture Handler

React Native Gesture Handler recognises touches natively on the UI thread and, with Reanimated, drives animations from gesture events without a JS round-trip; version 3 (May 2026) replaced the Gesture.Pan() builders with hooks such as usePanGesture and new composition hooks.

The notes

What you must know

  • Why not PanResponder: PanResponder runs in JS, so every touch event waits for the JS thread. Gesture Handler recognises gestures natively.
  • GestureHandlerRootView must wrap the app near the root; gestures outside it are not recognised.
  • RNGH 3 (New Architecture only): usePanGesture, useTapGesture, usePinchGesture, useLongPressGesture and more. Config is one object and can hold shared values. Callbacks: onBegin, onActivate, onUpdate, onDeactivate (onStart became onActivate, onEnd became onDeactivate).
  • Composition: useSimultaneousGestures (pinch + pan together), useExclusiveGestures (double tap before single tap), useCompetingGestures (replaced Race). Relations across components: simultaneousWith, requireToFail, block.
  • RNGH 2.x builders (Gesture.Pan(), Gesture.Simultaneous, simultaneousWithExternalGesture) are now "legacy", but you will still see them in older code and in interviews.
  • With Reanimated, gesture callbacks are worklets on the UI thread: update shared values there, and on release hand the velocity to withDecay or withSpring.
  • Inside a pager or a scroll view, use activation and fail offsets so the right gesture wins.

The red pen

Common traps: mistake → fix

  • Mistake: "PanResponder is fine for 60 fps drags"

    Fix: it is tied to the JS thread.

  • Mistake: "Gesture.Pan() is the current API"

    Fix: it is the legacy v2 API; v3 uses hooks.

  • Mistake: "I forgot GestureHandlerRootView"

    Fix: gestures silently do nothing.

Easy to hard

Questions interviewers ask, easy to hard

  1. Why use Gesture Handler instead of PanResponder?
  2. Make a pinch-zoom image that can also be panned, inside a horizontal pager.
  3. How do you combine gestures: simultaneous vs exclusive vs competing?
  4. Build a bottom sheet with snap points at 40% and 90% that closes on a fast downward fling.

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