/** https://reactnative.dev/docs/touchableopacity */ import React, { Component } from "react"; import { StyleSheet, Text, TouchableOpacity, View } from "react-native"; class App extends Component { constructor(props) { super(props); this.state = { count: 0 }; } onPress = () => { this.setState({ count: this.state.count + 1 }); }; render() { const { count } = this.state; return ( Count: {count} Press Here ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "center", paddingHorizontal: 10 }, button: { alignItems: "center", backgroundColor: "#DDDDDD", padding: 10 }, countContainer: { alignItems: "center", padding: 10 } }); export default App;