React Native Webview not loading any url (React native web view not working)

后端 未结 14 1884
悲哀的现实
悲哀的现实 2020-12-14 05:41

I am trying to implement react native webview component in my application, but the web view is not loading any url its just showing the white page.

var React         


        
相关标签:
14条回答
  • 2020-12-14 06:36

    WebView works well on Android. However you need to enable javascript and dom storage for some web pages.

    <WebView style={styles.webView}
        source={{uri: 'https://google.com/'}}
        javaScriptEnabled={true}
        domStorageEnabled={true}
        startInLoadingState={true}
        >
    </WebView>
    
    0 讨论(0)
  • 2020-12-14 06:38

    Below is piece of the code which worked for me.

    render: function(){
       return(
         <View style={styles.container}>
          <WebView url={'https://m.facebook.com'} style= {styles.webView}/>
         </View>
       );
     }
    
    0 讨论(0)
提交回复
热议问题