title: Detect button click from WebView in React Native
body: <p>Can anyone please help me on how to detect Webview button click event in React Native? As shown in the code below, I have a Button in my WebView (index.html) for which i want to detect click event from React Native and execute the method onClick. I have tried multiple ways, but couldn't succeed. Thanks so much in Advance.</p>
  
  <p>my MyApp.js</p>
  
  <pre><code>import React from 'react';
  import { AppRegistry, View, WebView, StyleSheet} from 'react-native'
  
  export default class MyApp extends React.Component {
  onClick = () =&gt; {
    console.log('Button Clicked');
  }
  render() {
      return (
          &lt;View style={styles.container}&gt;
              &lt;WebView
                  style={styles.webView}
                  source={require('./index.html')}/&gt;
          &lt;/View&gt;
      );
  }
  };
  
  let styles = StyleSheet.create({
  container: {
      flex: 1,
      backgroundColor: '#fff',
  },
  webView: {
      backgroundColor: '#fff',
      height: 350,
  }
  });
  </code></pre>
  
  <p>my index.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;Button&gt;Click Here&lt;/Button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>