title: navigate to a react native page from webview
body: <p>I have a react native app that uses webView to render an html code , i used postmessage for communicating between them. webview will send message to react native to open another react native page ( for example send message 'open login page' ) so i will recieve it in onMessage (event) , then when i want to use <code>this.props.navigateTo</code> it says 'can not read property navigateTo of undefined' . 
  i used <code>console.log(this)</code> and understood 'this' is <strong>DedicatedWorkerGlobalScope</strong>, that i can't use <code>navigatTo()</code> . how can i use navigatTo in this case (while im in DedicatedWorkerGlobalScope) or how can i close or stop rendering webview to do this?</p>
  
  <pre><code>  onMessage( event ) {
      let post = JSON.parse(event.nativeEvent.data);
      console.log(event)
     switch(post.message){
  
         case 'open login page':
             console.log(this); // 'DedicatedWorkerGlobalScope'
            this.props.navigateTo('login'); //'can not read property navigation of undefined'
             break;
     }
  }
  </code></pre>
  
  <p>this is the webview :</p>
  
  <pre><code>  &lt;WebView
              // onNavigationStateChange={async (e) =&gt; {
              //     console.log(e);
              //      if (async() =&gt; await getKey('isLogged') === false)
              //          this.props.navigateTo('login') //its ok here
              // }}
              source={{uri: isAndroid ?'file:///android_asset/html/index.html'
                  :'./html/index.html'}}
              ref={ webView =&gt; this.webView = webView }
              onMessage={this.onMessage}
          /&gt;
  </code></pre>
  
  <p>i use <code>this.props.navigatTo()</code> for navigating and its ok but in this case state doesnt change to run this here ,
    and this is my stacknavigator :</p>
  
  <pre><code>  login: {
          screen: Login
      },
      app: {
          screen: App  // webview defined here
      },
  </code></pre>