lucasferreira / react-native-webview-android

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

blank component #90

Closed spearmootz closed 6 years ago

spearmootz commented 6 years ago

i dont know why i get a blank screen when i use this module. im trying this out on index.js

var WebViewAndroid = require('react-native-webview-android');

import { AppRegistry } from 'react-native';

class Whatever extends Component {
  render () {
    return <WebViewAndroid url='https://www.google.com' javaScriptEnabled={true}
      geolocationEnabled={false} style={{ flex: 1 }} />;
  }
}

AppRegistry.registerComponent('whatever', () => Whatever);
guyzmo commented 6 years ago

I'm also getting a blank component trying this module. Not sure what I might have done wrong, I have no build time or compile time error.

stefanflondor commented 6 years ago

same for me, but it worked in dec 2017

croftman commented 6 years ago

Same here !

 import React, { Component } from 'react';
 import {
     AppRegistry,
     Platform,
     StyleSheet,
     Text,
     View,
     WebView
 } from 'react-native';

 var WebViewAndroid = require('react-native-webview-android');
 var SITE_URL = "https://google.fr";

 type Props = {};
 export default class App extends Component<Props> {

     render() {
         return <WebViewAndroid ref="webViewAndroidSample" javaScriptEnabled={true} geolocationEnabled={false} builtInZoomControls={false} url={SITE_URL} />;
     }
}
lucasferreira commented 6 years ago

Hi @croftman

Please try to insert your webview inside a View, and please try to put some style with and height or flex: 1 in your container and WebViewAndroid.

croftman commented 6 years ago

Nice ! It works just with flex :1 :) Thank you !

kkureli commented 3 years ago

If don't have, add https beginning of the url