Handling simultaneous button presses in React Native Android

43 views Asked by At

Trying to handle simultaneous button presses in React Native in Android. So far got this code

export default function App() {
  function click1() {
    console.log("click1");
  }

  function click2() {
    console.log("clock2");
  }

  function click1Out() {
    console.log("click1Out");
  }

  function click2Out() {
    console.log("clock2Out");
  }

  return (
    <View style={styles.container}>
      <View onTouchStart={click1} onTouchEnd={click1Out}>
        <TouchableHighlight>
          <View style={styles.button}></View>
        </TouchableHighlight>
      </View>
      <View onTouchStart={click2} onTouchEnd={click2Out}>
        <TouchableHighlight>
          <View style={styles.button}></View>
        </TouchableHighlight>
      </View>
    </View>
  );
}

Works perfectly on iOS, doesn't on Android(Expo managed). After two days of googling(reddit, stackoverflow,medium etc.) got nowhere. Any idea why or how to make it work ?

0

There are 0 answers