Component - Gesture Handler integration
This component shows how to use Gesture Handler in React Native to detect a tap gesture on a button. When the button is tapped, the text changes to confirm the tap.
This component shows how to use Gesture Handler in React Native to detect a tap gesture on a button. When the button is tapped, the text changes to confirm the tap.
GestureHandlerRootView
└── View
├── Text
└── TapGestureHandler
└── View
└── TextGestureHandlerRootView?import { TapGestureHandler, GestureHandlerRootView } from 'react-native-gesture-handler';
import React from 'react';
import { View, Text, Alert } from 'react-native';
export default function App() {
const onTap = () => Alert.alert('Box tapped!');
return (
);
}import { TapGestureHandler } from 'react-native-gesture-handler';
import React from 'react';
import { View } from 'react-native';
export default function App() {
const onTap = () => console.log('Tapped');
return (
);
}Pass the test and this pattern moves unknown