In a real app
The install requires a GestureHandlerRootView at the root of the app (the Expo template puts it there for you), otherwise gestures do not respond on Android, often with no message at all. The API to use today is the version 3 hooks (usePanGesture and friends) with GestureDetector; the v2 Gesture builder and the older PanGestureHandler components are no longer the recommended path. Callbacks (onBegin, onActivate, onUpdate, onDeactivate) follow the gesture state machine, and onUpdate fires on every frame.
The central pitfall is composition with scroll views and navigators: a horizontal Pan inside a vertical list, the native stack’s back gesture, a ScrollView swallowing the gesture. activation and failure offsets, simultaneousWith, and requireToFail are the settings to know, and it has to be tested on an Android device, whose touch dispatch differs from iOS. A gesture that works on the iOS simulator and not on Android is the textbook case.
With Reanimated, callbacks are worklets: no setState or navigation inside without scheduleOnRN. To confirm a gesture is handled natively, a console.log in onUpdate should come from the UI runtime, and smoothness should hold while a heavy setState runs on the JS thread.
Related terms
Reanimated
Software Mansion’s animation library that runs animations on the UI thread through worklets, without waiting on the JavaScript thread.
Worklet
A small JavaScript function the Reanimated Babel plugin extracts to run on the UI thread, in a separate runtime.
React Navigation
The standard navigation library for React Native: stack, tabs, drawer, with native screens through react-native-screens.
Expo Router
Expo’s file-based router: every file in the app directory becomes a screen, with deep links and typed routes out of the box.