P
P
progerstas2020-12-25 19:04:05
JavaScript
progerstas, 2020-12-25 19:04:05

Why is WebView not working?

I'm using the code below to embed a website in an app:

import React from 'react'
import {View, Text, StyleSheet} from 'react-native'
import {WebView} from 'react-native-webview'

export const Browser = props => {
    return (
        <View>
            <WebView source={{uri: 'http://facebook.com/'}} style={{flex:1}} javaScriptEnabled={true} />
        </View>
    )
}

BUT nothing happens.
unknown.png?width=336&height=703

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Alexandrovich, 2020-12-25
@RomReed

import React from 'react'
import {View, Text, StyleSheet} from 'react-native'
import {WebView} from 'react-native-webview'

export const Browser = props => {
    return (
        <View style={{flex:1, width:"100%",height:"100%"}}>
            <WebView source={{uri: 'http://facebook.com/'}} style={{flex:1}} javaScriptEnabled={true} />
        </View>
    )
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question