lucasferreira / react-native-webview-android

Simple React Native Android module to use Android's WebView inside your app
355 stars 158 forks source link

Can not navigate the new url when WebViewAndroid has props: onShouldStartLoadWithRequest #105

Closed vantb9x closed 6 years ago

vantb9x commented 6 years ago

When I have this code with onShouldStartLoadWithRequest for preventing some url:

 <WebViewAndroid
               ref="_webView"
                onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequestAndroid}
               source={{uri: 'https://www.google.com'}}
               style={styles.containerWebView}
             />`
  onShouldStartLoadWithRequest(event) {
      if (event.url === 'https://www.mywebsiteexample.com/') {
        return true;
      } else {
        return false;
      }
    }

When I click any link on google website, it can not open new page in WebViewAndroid. It stays at google homepage. 1531278642366

I want it will navigate to exactly page.