Skip to content

Commit eb83d43

Browse files
committed
Add states table
1 parent 1b25b59 commit eb83d43

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

packages/docs-gesture-handler/docs/fundamentals/callbacks-events.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ import {GestureEventFlowChart, TouchEventFlowChart} from '@site/src/examples/Cal
1010
Every gesture can be treated as ["state machine"](https://en.wikipedia.org/wiki/Finite-state_machine).
1111
At any given time, each handler instance has an assigned state that can change when new touch events occur or can be forced to change by the touch system in certain circumstances.
1212

13+
## States
14+
15+
States manage the internal recognition process. You can hook into these transitions using specific gesture callbacks.
16+
17+
| State | Description | Callback |
18+
| :--- | :--- | :--- |
19+
| **`UNDETERMINED`** | The default initial state of every handler. ||
20+
| **`BEGAN`** | The handler has started receiving touch data but hasn't yet met the activation criteria. | [`onBegin`](#onbegin) |
21+
| **`ACTIVE`** | The gesture is recognized and activation criteria are met. | [`onActivate`](#onactivate) / [`onUpdate`](#onupdate) |
22+
| **`END`** | The user successfully completed the gesture. | [`onDeactivate`](#ondeactivate) |
23+
| **`FAILED`** | The handler failed to recognize the gesture. | [`onFinalize`](#onfinalize) |
24+
| **`CANCELLED`** | The system interrupted the gesture. | [`onFinalize`](#onfinalize) |
25+
26+
1327
## Events
1428

1529
There are two types of events in RNGH3: `GestureEvent` and `TouchEvent`.
@@ -29,6 +43,10 @@ There are two types of events in RNGH3: `GestureEvent` and `TouchEvent`.
2943

3044
## Callbacks
3145

46+
:::info
47+
`HandlerData` in the following callbacks refers to gesture-specific event data documented in each gesture's page.
48+
:::
49+
3250
### onBegin
3351

3452
```ts

0 commit comments

Comments
 (0)