Waleed Arshad Waleed Arshad - 4 months ago 27
React JSX Question

How to put WebView inside View

I need to customize my

WebView
in React Native with header and footer. but
WebView
does not load URL when put inside
View
. How can I achieve this functionality?

<View style={styles.mainSection}>
<WebView
source={{uri: this.props.mediaItem.source}}
style={{marginTop: 20}}
/>
</View>

amb amb
Answer

I think your problem is related to the size of the WebView component. Try to put flex: 1 into your WebView style.