'React Native: Text onPress not working on android

I have the following code:

<Text onPress={() => console.log('this won\'t print')}>Dumb text</Text>

According to React Native's documentation, this works great in both iOS and Android, however when I run it myself, it only works on iOS, while Android acts as if the onPress prop doesn't exist at all.

I know I can use TouchableOpacity (all other questions talk about this), but I just need confirmation on whether I am missing something or if this is how it always has been and the documentation is incomplete.



Solution 1:[1]

Your code seems perfectly right and works for me... Try reloading or reinstalling the app 2-3 times.. It should work

This is what I tried and worked :

<Text style={{color:'white', fontSize : 50}} onPress={() => console.log("pressed")}>Hello</Text>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Deep Togani