Skip to content

Conditionally disable GestureDetector? #3161

Answered by Glazzes
Nantris asked this question in Q&A
Discussion options

You must be logged in to vote

All gestures have a method called enabled, you can enable a gesture dynamically like this:

const [isEnabled, setIsEnabled] = useState<boolean>(true);

const pinch = Gesture.Pinch().enabled(isEnabled);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Nantris
Comment options

Answer selected by Nantris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants