Description
Pressable doesn't work on android (works in ios and web). see snack below
https://snack.expo.dev/@mancitiss/react-native-gesture-handler-pressable-not-working-on-android?platform=android
Steps to reproduce
npx create-expo --example blank
cd blank
npm install
- edit blank/app/(tabs)/index.tsx, replace everything with just this
import { Text } from 'react-native';
import React from 'react';
import { GestureHandlerRootView, Pressable } from 'react-native-gesture-handler';
export default function HomeScreen() {
const [count, setCount] = React.useState(0);
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<Pressable onPress={() => setCount((c) => c + 1)} style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>{count}</Text>
</Pressable>
</GestureHandlerRootView>
);
}
npm run start
- open expo go on android phone and connect to the app
- tap the screen.
expected behavior: the number goes up
ios, web: the number goes up
android: the number doesn't go up
- test with react-native Pressable:
import { Text } from 'react-native';
import React from 'react';
import { Pressable } from 'react-native';
export default function HomeScreen() {
const [count, setCount] = React.useState(0);
return (
<Pressable onPress={() => setCount((c) => c + 1)} style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>{count}</Text>
</Pressable>
);
}
all platforms work.
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
https://snack.expo.dev/@mancitiss/react-native-gesture-handler-pressable-not-working-on-android?platform=android
Gesture Handler version
~2.28.0
React Native version
0.79.0 + 0.81.5
Platforms
Android
JavaScript runtime
None
Workflow
Using Expo Go
Architecture
None
Build type
None
Device
Real device
Device model
Galaxy A13 (Android 12)
Acknowledgements
Yes
Description
Pressable doesn't work on android (works in ios and web). see snack below
https://snack.expo.dev/@mancitiss/react-native-gesture-handler-pressable-not-working-on-android?platform=android
Steps to reproduce
npx create-expo --example blankcd blanknpm installnpm run startexpected behavior: the number goes up
ios, web: the number goes up
android: the number doesn't go up
all platforms work.
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
https://snack.expo.dev/@mancitiss/react-native-gesture-handler-pressable-not-working-on-android?platform=android
Gesture Handler version
~2.28.0
React Native version
0.79.0 + 0.81.5
Platforms
Android
JavaScript runtime
None
Workflow
Using Expo Go
Architecture
None
Build type
None
Device
Real device
Device model
Galaxy A13 (Android 12)
Acknowledgements
Yes