Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a14db83
Fix edit link
m-bert Feb 4, 2026
9e1f534
introduction
m-bert Feb 4, 2026
54889bb
installation
m-bert Feb 4, 2026
3e82cf8
Gesture detector
m-bert Feb 4, 2026
e005621
Reanimated interactions
m-bert Feb 4, 2026
90b1aa4
Animated interactions
m-bert Feb 4, 2026
a5b73b3
Composition
m-bert Feb 5, 2026
6c4aa0f
Merge branch 'main' into @mbert/docs-review
m-bert Feb 6, 2026
b2f97c5
State manager
m-bert Feb 5, 2026
8cb20ab
Callbacks
m-bert Feb 5, 2026
8f442f1
Quickstart
m-bert Feb 5, 2026
12abfeb
Troubleshooting
m-bert Feb 5, 2026
1094f92
Testing
m-bert Feb 6, 2026
d91e097
Fix callbacks flow chart
m-bert Feb 6, 2026
c503ea1
Pan
m-bert Feb 6, 2026
31a8db3
Tap
m-bert Feb 6, 2026
b3efbbe
LongPress
m-bert Feb 6, 2026
d201b3e
Rotation
m-bert Feb 6, 2026
62d0fe8
Pinch
m-bert Feb 6, 2026
64aa192
Fling
m-bert Feb 6, 2026
4667c7d
Hover
m-bert Feb 6, 2026
5f40baf
Native
m-bert Feb 6, 2026
800b37d
Manual
m-bert Feb 6, 2026
004f919
Touch events
m-bert Feb 6, 2026
e8ddacc
Pinch typo
m-bert Feb 6, 2026
128b226
HOOOOOOOOOOOOOOOOOOOOW?
m-bert Feb 6, 2026
cc1e783
Update packages/docs-gesture-handler/docs/guides/testing.md
m-bert Feb 9, 2026
d48e4ea
Update packages/docs-gesture-handler/docs/fundamentals/gesture-detect…
m-bert Feb 9, 2026
9f1ec51
Overrides
m-bert Feb 9, 2026
9b4aff8
Fix broken link
m-bert Feb 9, 2026
0ce4f89
Merge branch 'main' into @mbert/docs-review
m-bert Feb 9, 2026
1b48239
Pressable
m-bert Feb 9, 2026
e9e88a5
Swipeable
m-bert Feb 9, 2026
5fcdc6c
Drawer
m-bert Feb 9, 2026
6d909f3
Minor adjustments
m-bert Feb 10, 2026
4a901f8
Add root view page
m-bert Feb 10, 2026
17fc108
Update packages/docs-gesture-handler/docs/fundamentals/installation.mdx
m-bert Feb 11, 2026
6563cdc
Update packages/docs-gesture-handler/docs/fundamentals/gesture-detect…
m-bert Feb 11, 2026
f3500a4
Update kotlin version
m-bert Feb 11, 2026
9840339
Merge branch '@mbert/docs-review' of github.com:software-mansion/reac…
m-bert Feb 11, 2026
3d706ec
Update packages/docs-gesture-handler/docs/fundamentals/state-manager.mdx
m-bert Feb 11, 2026
2a877d9
Update packages/docs-gesture-handler/docs/fundamentals/state-manager.mdx
m-bert Feb 11, 2026
f927bf5
Remove ts block
m-bert Feb 11, 2026
18e4350
Update packages/docs-gesture-handler/docs/gestures/use-native-gesture…
m-bert Feb 11, 2026
8232dc8
Merge branch 'main' into @mbert/docs-review
m-bert Feb 11, 2026
6386f61
Merge branch '@mbert/docs-review' into @mbert/docs-root-view
m-bert Feb 11, 2026
8ea2e67
Merge branch '@mbert/docs-root-view' of github.com:software-mansion/r…
m-bert Feb 11, 2026
aec1a4a
Bring back root view to example in Pressable
m-bert Feb 11, 2026
264a843
Merge branch '@mbert/docs-review' of github.com:software-mansion/reac…
m-bert Feb 11, 2026
4fd4d8c
Rea and Ani
m-bert Feb 11, 2026
a09df73
Move examples to separate files
m-bert Feb 11, 2026
6f8f71f
Merge branch '@mbert/docs-review' into @mbert/docs-root-view
m-bert Feb 11, 2026
47b6daf
Rephrase note
m-bert Feb 11, 2026
f94da57
Remove a
m-bert Feb 11, 2026
c9c429e
manualActivation
m-bert Feb 11, 2026
ca8179c
Merge branch 'main' into @mbert/docs-review
m-bert Feb 12, 2026
941be7d
Merge branch '@mbert/docs-review' into @mbert/docs-root-view
m-bert Feb 12, 2026
f315f93
Change header
m-bert Feb 12, 2026
8397376
Merge branch 'main' into @mbert/docs-root-view
m-bert Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This component is a drop-in replacement for the `Pressable` component.

`Pressable` is a component that can detect various stages of tap, press, and hover interactions on any of its children.

To use `Pressable`, ensure that your app is wrapped in `GestureHandlerRootView` and import it as follows:
To use `Pressable`, ensure that your app is wrapped in [`GestureHandlerRootView`](/docs/fundamentals/root-view) and import it as follows:

```ts
import { Pressable } from 'react-native-gesture-handler';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
This component acts as a cross-platform replacement for React Native's [`DrawerLayoutAndroid`](http://reactnative.dev/docs/drawerlayoutandroid.html) component, written using [Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started). For detailed information on standard parameters, please refer to the [React Native documentation](http://reactnative.dev/docs/drawerlayoutandroid.html).
:::

To use `ReanimatedDrawerLayout`, first ensure that Reanimated is installed and that your app is wrapped in `GestureHandlerRootView`. You can then import it as follows:
To use `ReanimatedDrawerLayout`, first ensure that Reanimated is installed and that your app is wrapped in [`GestureHandlerRootView`](/docs/fundamentals/root-view). You can then import it as follows:

```ts
import ReanimatedDrawerLayout from 'react-native-gesture-handler/ReanimatedDrawerLayout';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: animated-interactions
title: Integration with Animated
sidebar_label: Integration with Animated
sidebar_position: 5
sidebar_position: 9
---

import CollapsibleCode from '@site/src/components/CollapsibleCode';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: callbacks-events
title: Gesture callbacks & events
sidebar_label: Gesture callbacks & events
sidebar_position: 7
sidebar_position: 6
---

import { GestureEventFlowChart, TouchEventFlowChart } from '@site/src/examples/CallbacksFlowCharts'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: gesture-composition
title: Gesture composition & interactions
sidebar_label: Gesture composition & interactions
sidebar_position: 6
sidebar_position: 5
---

import CollapsibleCode from '@site/src/components/CollapsibleCode';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: gesture-detectors
title: Gesture Detectors
sidebar_label: Gesture detectors
sidebar_position: 3
sidebar_position: 4
---

import CollapsibleCode from '@site/src/components/CollapsibleCode';
Expand Down
18 changes: 2 additions & 16 deletions packages/docs-gesture-handler/docs/fundamentals/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Setting up `react-native-gesture-handler` is pretty straightforward:
</TabItem>
</Tabs>

### 2. Wrap your app with `GestureHandlerRootView` component
### 2. Wrap your app with GestureHandlerRootView component

```jsx
import { GestureHandlerRootView } from 'react-native-gesture-handler';
Expand All @@ -62,21 +62,7 @@ export default function App() {
```
Keep `GestureHandlerRootView` as close to the actual root of the app as possible. It's the entry point for all gestures and all [gesture relations](/docs/fundamentals/gesture-composition). The gestures won't be recognized outside of the root view, and relations only work between gestures mounted under the same root view.

If you don't provide anything to the `styles` prop, it will default to `flex: 1`. If you want to customize the styling of the root view, don't forget to also include `flex: 1` in the custom style, otherwise your app won't render anything.

If you're unsure if one of your dependencies already renders `GestureHandlerRootView` on its own, don't worry and add one at the root anyway. In case of nested root views, Gesture Handler will only use the top-most one and ignore the nested ones.

:::note
Remember that you need to wrap each screen that you use in your app with `GestureHandlerRootView` as with native navigation libraries each screen maps to a separate root view. It will not be enough to wrap the main screen only.
:::

#### Using `GestureHandlerRootView` with third party libraries

If you're having trouble with gestures not working when inside a component provided by a third-party library, even though you've wrapped the entry point with `<GestureHandlerRootView>`, you can try adding another `<GestureHandlerRootView unstable_forceActive>` closer to the place the gestures are defined. This way, you can prevent Android from canceling relevant gestures when one of the native views tries to grab lock for delivering touch events.

:::tip
If you're using Gesture Handler in your component library, you may want to wrap your library's code in the `GestureHandlerRootView` component. This will avoid extra configuration for the user.
:::
Check out [`GestureHandlerRootView`](/docs/fundamentals/root-view) section for more details.

### 3. Platform specific setup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: reanimated-interactions
title: Integration with Reanimated
sidebar_label: Integration with Reanimated
sidebar_position: 4
sidebar_position: 8
---

import CollapsibleCode from '@site/src/components/CollapsibleCode';
Expand Down
48 changes: 48 additions & 0 deletions packages/docs-gesture-handler/docs/fundamentals/root-view.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
id: root-view
title: GestureHandlerRootView
sidebar_label: GestureHandlerRootView
sidebar_position: 3
---

`GestureHandlerRootView` is a key component that enables Gesture Handler to intercept touch events, allowing for the implementation of gestures in your app. It should wrap your app's main component, and any component that relies on Gesture Handler's gestures has to be a descendant of this view. For more detailed information, you can check out the [under-the-hood section](/docs/under-the-hood/how-does-it-work#android).

```tsx
import { GestureHandlerRootView } from 'react-native-gesture-handler';

export default function App() {
return (
<GestureHandlerRootView>
<ActualApp />
</GestureHandlerRootView>
);
}
```

Keep `GestureHandlerRootView` as close to the actual root of the app as possible. It's the entry point for all gestures and all [gesture relations](/docs/fundamentals/gesture-composition). The gestures won't be recognized outside of the root view, and relations only work between gestures mounted under the same root view.

:::note
When integrating with navigation libraries, wrapping the navigator component with `GestureHandlerRootView` is generally sufficient. However, if you encounter issues with gestures not functioning properly, you might need to wrap each individual screen component with `GestureHandlerRootView` as well.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The navigation note is a bit ambiguous: it suggests wrapping the navigator is usually enough and wrapping individual screens is only needed when issues occur. However, the installation docs still state that with native navigation libraries (e.g. wix/react-native-navigation) each screen must be wrapped because each screen maps to a separate root view. Consider updating this note to explicitly call out that distinction (JS-based nav vs native nav) or linking directly to the relevant installation section to avoid misconfiguration.

Suggested change
When integrating with navigation libraries, wrapping the navigator component with `GestureHandlerRootView` is generally sufficient. However, if you encounter issues with gestures not functioning properly, you might need to wrap each individual screen component with `GestureHandlerRootView` as well.
For JavaScript-based navigation libraries (such as React Navigation), wrapping the top-level navigator component with `GestureHandlerRootView` is generally sufficient because all screens share a single React Native root view. For native navigation libraries (such as `wix/react-native-navigation`), each native screen is its own root view, so **each screen component must be wrapped** with `GestureHandlerRootView`, as described in the [installation guide](/docs/installation).

Copilot uses AI. Check for mistakes.
:::

:::tip
If you're using Gesture Handler in your component library, you may want to wrap your library's code in the `GestureHandlerRootView` component. This will avoid extra configuration for the user.
:::

## Styling

`GestureHandlerRootView` can be thought of as a regular `View` component, therefore it accepts all the same props, including [`style`](https://reactnative.dev/docs/0.81/view-style-props).
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The React Native docs link is pinned to a specific version (0.81). This will go stale and is inconsistent with the rest of the docs here; consider using the unversioned React Native URL (e.g. /docs/view-style-props) so the link stays valid across RN minor versions.

Suggested change
`GestureHandlerRootView` can be thought of as a regular `View` component, therefore it accepts all the same props, including [`style`](https://reactnative.dev/docs/0.81/view-style-props).
`GestureHandlerRootView` can be thought of as a regular `View` component, therefore it accepts all the same props, including [`style`](https://reactnative.dev/docs/view-style-props).

Copilot uses AI. Check for mistakes.

If you don't provide anything to the `style` prop, it will default to `{ flex: 1 }`. If you want to customize the styling of the root view, don't forget to also include `flex: 1` in the custom style, otherwise your app won't render anything.

## Nesting root views

In case of nested root views, Gesture Handler will only use the top-most one and ignore the nested ones. If you're unsure if one of your dependencies already renders `GestureHandlerRootView` on its own, don't worry and add one at the root anyway.

## unstable_forceActive

```ts
unstable_forceActive?: boolean;
```

If you're having trouble with gestures not working when inside a component provided by a third-party library, even though you've wrapped the entry point with `<GestureHandlerRootView>`, you can try adding another `<GestureHandlerRootView unstable_forceActive>` closer to the place the gestures are defined. This way, you can prevent Android from canceling relevant gestures when one of the native views tries to grab lock for delivering touch events.
Comment on lines +38 to +48
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “Nesting root views” section says nested root views are ignored, but later the page recommends adding a nested GestureHandlerRootView unstable_forceActive. On Android, nested root views are disabled by default but can be enabled when unstable_forceActive is set, so this section should clarify that nested root views are ignored unless unstable_forceActive forces the nested one to become active.

Copilot uses AI. Check for mistakes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: state-manager
title: State manager
sidebar_label: State manager
sidebar_position: 6
sidebar_position: 7
---

import CollapsibleCode from '@site/src/components/CollapsibleCode';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This library is maintained by a very small team. Please keep this in mind when r
- Changing `enabled` prop during a gesture has no effect, only when a gesture starts (that is a finger touches the screen) the `enabled` prop is taken into consideration to decide whether to extract (or not) the gesture and provide it with stream of events to analyze.
- `Native` gesture may not conform to the standard state flow due to platform specific workarounds to incorporate native views into RNGH.
- Keep in mind that [`Touchables`](/docs/components/touchables) from RNGH are rendering two additional views that may need to be styled separately to achieve desired effect (`style` and `containerStyle` props).
- In order for the [gesture composition](/docs/fundamentals/gesture-composition) to work, all composed gestures must be attached to the same `GestureHandlerRootView`.
- In order for the [gesture composition](/docs/fundamentals/gesture-composition) to work, all composed gestures must be attached to the same [`GestureHandlerRootView`](/docs/fundamentals/root-view).

## Multiple instances of Gesture Handler were detected

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ All gestures are implemented using [UIGestureRecognizers](https://developer.appl
## Android

Unfortunately, Android doesn't provide an easy way of handling gestures hence most of them were implemented from scratch, including a system for managing how the gestures should interact with each other. Here's a quick overview of how it works:
When you wrap a component with `GestureHandlerRootView` it allows for the RNGH to intercept all touch events on that component and process them, deciding whether they should be handled by one of the gesture handlers or passed to the underlying view. Gesture handlers are created right at the moment you declare them in order to initialize all of the necessary handlers natively. Every `GestureHandlerRootView` also has a specific handler to decide whether to pass the touch events or to consume them. It can never activate, only begin, end or be cancelled. When this handler is in the `UNDETERMINED` [state](/docs/under-the-hood/state) it means that there is no touch in progress, however when the touch starts it transitions to the `BEGAN` state. As long as it stays in that state, no touch event is consumed, but as soon as it gets cancelled (meaning that some handler has activated) all incoming touch events get consumed, preventing underlying view from receiving them.
When you wrap a component with [`GestureHandlerRootView`](/docs/fundamentals/root-view) it allows for the RNGH to intercept all touch events on that component and process them, deciding whether they should be handled by one of the gesture handlers or passed to the underlying view. Gesture handlers are created right at the moment you declare them in order to initialize all of the necessary handlers natively. Every `GestureHandlerRootView` also has a specific handler to decide whether to pass the touch events or to consume them. It can never activate, only begin, end or be cancelled. When this handler is in the `UNDETERMINED` [state](/docs/under-the-hood/state) it means that there is no touch in progress, however when the touch starts it transitions to the `BEGAN` state. As long as it stays in that state, no touch event is consumed, but as soon as it gets cancelled (meaning that some handler has activated) all incoming touch events get consumed, preventing underlying view from receiving them.

When a pointer touches the screen the view tree is traversed in order to extract all handlers attached to the views below the finger (including the one attached to the `GestureHandlerRootView`) and all extracted handlers transition to the `BEGAN` state, signalling that the gesture may have began. The touch events continue to be delivered to all extracted handlers until one of them recognizes the gesture and tries to activate. At this point the orchestrator checks whether this gesture should wait for any other of the extracted gestures to fail. If it does, it's put to the waiting list, if it doesn't, it gets activated and all other gestures (that are not simultaneous with it) get cancelled. When a gesture handlers transitions to a finished state (the gesture recognized by it stops, fails or gets cancelled) the orchestrator checks the waiting handlers. Every one of them that waited for the gesture that just failed tries to activate again (and again the orchestrator checks if it should wait for any of the extracted gestures...).