Help me To fix these issues ONlY android Side
Android app Crashing due to GestureHandlerRootView
explain reason if possible
other imports...
import Header from '../../Components/Header';
import {
GestureDetector,
Gesture,
GestureHandlerRootView,
} from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
function ContactUs({navigation}) {
const [swipeData, setSwipeData] = React.useState('Swipe Please');
let startX = 0;
const tap = Gesture.Pan()
.onBegin(e => {
startX = e.x;
console.log('Gesture started at:', startX);
})
.onUpdate(e => {
const deltaX = e.x - startX;
})
.onEnd(e => {
const deltaX = e.x - startX;
if (deltaX > 50) {
setSwipeData('left to right');
console.log('Scrolled from left to right');
} else if (deltaX < -50) {
setSwipeData('right to left');
console.log('Scrolled from right to left');
} else {
setSwipeData("Not enough Swiped || It's horizontal movement");
console.log("Not enough Swiped || It's horizontal movement");
}
console.log('Gesture ended at:', e.x, 'with deltaX:', deltaX);
})
.onFinalize(() => {
startX = 0;
});
return (
<GestureHandlerRootView style={{flex:1}}>
<SafeAreaView style={styles.mainContainer}>
<Header canGoBack={true} />
<GestureDetector gesture={tap}>
<Animated.View
style={{
flex: 1,
}}>
<Text>{swipeData}</Text>
</Animated.View>
</GestureDetector>
</SafeAreaView>
</GestureHandlerRootView>
);
}
export default ContactUs;
Just Willing to update state based on swipe Gesture
issue Occurs Only android side but IOS is Perfectely fine