Button onPress not working in android
See original GitHub issueThe onPress is not working on the android device.
<> <StatusBar backgroundColor={theme.bgColor} barStyle={'dark-content'} /> <Button title="Schedule a Free Trial" onPress={() => {console.log('pressesd');}} /> </>
This is my complete code and it is working in ios device but it is not working in the android device. Can you please check it.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12 (1 by maintainers)
Top Results From Across the Web
React-Native Button onPress not working - Stack Overflow
I'm trying to bind the function handleClick to my button onPress . But it's not working. When I refresh the page, I get...
Read more >Button onPress not triggering in debug mode with Android ...
Button onPress will not trigger in debug mode on. I created a brand new project with the cli tool and got it to...
Read more >React native TouchableOpacity onPress not working on Android
Android : React native TouchableOpacity onPress not working on Android [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >TouchableOpacity - React Native
A wrapper for making views respond properly to touches. On press down, the opacity of the wrapped view is decreased, dimming it.
Read more >React Native touchable vs. pressable components
button, { backgroundColor: '#2277ee' }]} onPress={onTap} activeOpacity={0.6}> <Text>Blue button</Text> </TouchableOpacity> <TouchableOpacity ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just verified that this happens with:
<ListItem onPress={() => Alert.alert("Click!')} />
However, when debug mode turned off, it works perfectly fine. Note that my
ListItem
is placed inside areact-navigation@4
drawer. Since it is debugger-related I cannot create a snack for it.Hello, thanks. Did you ran it on android device? still doesn’t change the text. Anyway I found the solution using the prop TouchableComponent and use TouchableOpacity from react-native-gesture-handler.
https://snack.expo.io/@abrahamjsb/bug-button-onpress