GestureDetector is the main component of the RNGH2. It is responsible for creating and updating native gesture handlers based on the config of provided gesture. The most significant difference between it and old gesture handlers is that the
GestureDetector can recognize more than one gesture at the time thanks to gesture composition. Keep in mind that
GestureDetector is not compatible with the Animated API, nor with Reanimated 1.
Gesture Detector will use first native view in its subtree to recognize gestures, however if this view is used only to group its children it may get automatically collapsed. Consider this example:
A gesture object containing the configuration and callbacks. Can be any of the base gestures (
ForceTouch) or any
GestureDetector will decide whether to use Reanimated to process provided gestures based on callbacks they have. If any of the callbacks is a worklet, tools provided by the Reanimated will be utilized bringing ability to handle gestures synchrously.