$ npm install react-native-tencentx5 --save
From react-native 0.60 autolinking
$ react-native link react-native-tencentx5
import { WebView } from 'react-native-tencentx5';
<WebView
url={"https://facebook.github.io/react-native"}
style={{ flex: 1 }}
/>
url
style
- onPageStarted
- onPageFinished
- onReceivedTitle
- onProgressChanged
- onGoBack
onMessage
javaScriptEnabled
domStorageEnabled
userAgent
cacheEnabled
textZoom
- scalesPageToFit
- applicationNameForUserAgent
- allowFileAccessFromFileURLs
- allowUniversalAccessFromFileURLs
- mixedContentMode
- allowFileAccess
- geolocationEnabled
Loads static URI in the WebView.
Type | Required |
---|---|
string | No |
Example:
<WebView
url={'https://facebook.github.io/react-native'}
/>
A style object that allow you to customize the WebView
style.
Type | Required |
---|---|
style | No |
Example:
<WebView
source={{ uri: 'https://facebook.github.io/react-native' }}
style={{ flex: 1 }}
/>
Function that is invoked when the webview calls window.WebViewJavascriptBridge.postMessage
. Setting this property will inject this global into your webview.
window.WebViewJavascriptBridge.postMessage
accepts one argument, data
, which will be available on the event object, event.nativeEvent.data
. data
must be a string.
Type | Required |
---|---|
function | No |
Boolean value to enable JavaScript in the WebView
.
Type | Required |
---|---|
bool | No |
Boolean value to control whether DOM Storage is enabled. Used only in Android.
Type | Required |
---|---|
bool | No |
Sets the user-agent for the WebView
.
Type | Required |
---|---|
string | No |
Sets whether WebView should use browser caching.
Type | Required |
---|---|
boolean | No |
If the user has set a custom font size in the Android system, an undesirable scale of the site interface in WebView occurs.
Type | Required |
---|---|
number | No |