title: how to Communicate between react-native webView and a React web-app?
body: <p>i'm trying to create a communication between a webView in react-native and a web-app created with React-360 (and of course React).
  I'm using the react-native-webview and I follow this guide at this link to create a communication:
  <a href="https://github.com/react-native-community/react-native-webview/blob/master/docs/Guide.md" rel="nofollow noreferrer">https://github.com/react-native-community/react-native-webview/blob/master/docs/Guide.md</a>
  Using the example in the page, with a simple html page (like in the example in the link) with the function <code>window.ReactNativeWebView.postMessage(data)</code> in the script section it works good:</p>
  
  <pre><code> &lt;WebView
    source={{uri: this.props.link}}
  
      ref={( webView ) =&gt; this.webView = webView}
  
      onMessage={event =&gt; {
        alert(event.nativeEvent.data);
      }}
    /&gt;
  </code></pre>
  
  <p>My purpose, however, is to call in my web application inside the webView <code>window.ReactNativeWebView.postMessage(data)</code> when i click a button, for example with a function like this:</p>
  
  <pre><code>homeButtonClicked() {
      console.log("sei uscito, torna all'App!")
      window.ReactNativeWebView.postMessage(data);
  }
  </code></pre>
  
  <p>Unfortunately, when i click the button i got the following error:
  <code>Cannot read property 'postMessage' of undefined</code>. How can i resolve this problem? Thanks to all.</p>