Grokking React Native
0% completed
Handling Swipe and Drag Gestures
A swipe and a drag start with exactly the same finger movement. The difference appears at release: a swipe is a decision, such as "dismiss this notification", while a drag is a new position, such as "leave this item here".
Both use usePanGesture, because both follow a moving finger. They differ only in what you do in onDeactivate. This lesson builds each one with useState, so the logic stays visible, and the next lesson adds animation. Both examples go inside the GestureHandlerRootView from the previous lesson.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%