|
@@ -16,6 +16,7 @@ This document lays out the current public properties and methods for the React N
|
16
|
16
|
- [`onLoad`](Reference.md#onload)
|
17
|
17
|
- [`onLoadEnd`](Reference.md#onloadend)
|
18
|
18
|
- [`onLoadStart`](Reference.md#onloadstart)
|
|
19
|
+- [`onLoadProgress`](Reference.md#onloadprogress)
|
19
|
20
|
- [`onMessage`](Reference.md#onmessage)
|
20
|
21
|
- [`onNavigationStateChange`](Reference.md#onnavigationstatechange)
|
21
|
22
|
- [`originWhitelist`](Reference.md#originwhitelist)
|
|
@@ -44,11 +45,11 @@ This document lays out the current public properties and methods for the React N
|
44
|
45
|
|
45
|
46
|
## Methods Index
|
46
|
47
|
|
47
|
|
-* [`extraNativeComponentConfig`](Reference.md#extranativecomponentconfig)
|
48
|
|
-* [`goForward`](Reference.md#goforward)
|
49
|
|
-* [`goBack`](Reference.md#goback)
|
50
|
|
-* [`reload`](Reference.md#reload)
|
51
|
|
-* [`stopLoading`](Reference.md#stoploading)
|
|
48
|
+- [`extraNativeComponentConfig`](Reference.md#extranativecomponentconfig)
|
|
49
|
+- [`goForward`](Reference.md#goforward)
|
|
50
|
+- [`goBack`](Reference.md#goback)
|
|
51
|
+- [`reload`](Reference.md#reload)
|
|
52
|
+- [`stopLoading`](Reference.md#stoploading)
|
52
|
53
|
|
53
|
54
|
---
|
54
|
55
|
|
|
@@ -64,17 +65,17 @@ The object passed to `source` can have either of the following shapes:
|
64
|
65
|
|
65
|
66
|
**Load uri**
|
66
|
67
|
|
67
|
|
-* `uri` (string) - The URI to load in the `WebView`. Can be a local or remote file.
|
68
|
|
-* `method` (string) - The HTTP Method to use. Defaults to GET if not specified. On Android, the only supported methods are GET and POST.
|
69
|
|
-* `headers` (object) - Additional HTTP headers to send with the request. On Android, this can only be used with GET requests.
|
70
|
|
-* `body` (string) - The HTTP body to send with the request. This must be a valid UTF-8 string, and will be sent exactly as specified, with no additional encoding (e.g. URL-escaping or base64) applied. On Android, this can only be used with POST requests.
|
|
68
|
+- `uri` (string) - The URI to load in the `WebView`. Can be a local or remote file.
|
|
69
|
+- `method` (string) - The HTTP Method to use. Defaults to GET if not specified. On Android, the only supported methods are GET and POST.
|
|
70
|
+- `headers` (object) - Additional HTTP headers to send with the request. On Android, this can only be used with GET requests.
|
|
71
|
+- `body` (string) - The HTTP body to send with the request. This must be a valid UTF-8 string, and will be sent exactly as specified, with no additional encoding (e.g. URL-escaping or base64) applied. On Android, this can only be used with POST requests.
|
71
|
72
|
|
72
|
73
|
**Static HTML**
|
73
|
74
|
|
74
|
75
|
_Note that using static HTML requires the WebView property [originWhiteList](Reference.md#originWhiteList) to `['*']`._
|
75
|
76
|
|
76
|
|
-* `html` (string) - A static HTML page to display in the WebView.
|
77
|
|
-* `baseUrl` (string) - The base URL to be used for any relative links in the HTML.
|
|
77
|
+- `html` (string) - A static HTML page to display in the WebView.
|
|
78
|
+- `baseUrl` (string) - The base URL to be used for any relative links in the HTML.
|
78
|
79
|
|
79
|
80
|
| Type | Required |
|
80
|
81
|
| ------ | -------- |
|
|
@@ -128,9 +129,9 @@ Override the native component used to render the WebView. Enables a custom nativ
|
128
|
129
|
|
129
|
130
|
The `nativeConfig` prop expects an object with the following keys:
|
130
|
131
|
|
131
|
|
-* `component` (any)
|
132
|
|
-* `props` (object)
|
133
|
|
-* `viewManager` (object)
|
|
132
|
+- `component` (any)
|
|
133
|
+- `props` (object)
|
|
134
|
+- `viewManager` (object)
|
134
|
135
|
|
135
|
136
|
| Type | Required |
|
136
|
137
|
| ------ | -------- |
|
|
@@ -178,6 +179,21 @@ Function that is invoked when the `WebView` starts loading.
|
178
|
179
|
|
179
|
180
|
---
|
180
|
181
|
|
|
182
|
+### `onLoadProgress`
|
|
183
|
+
|
|
184
|
+Function that is invoked when the `WebView` is loading.
|
|
185
|
+
|
|
186
|
+> **_Note_**
|
|
187
|
+>
|
|
188
|
+> On iOS, when useWebKit=false, this prop will not work.
|
|
189
|
+> On android, You can't get the url property, meaning that `event.nativeEvent.url` will be null.
|
|
190
|
+
|
|
191
|
+| Type | Required |
|
|
192
|
+| -------- | -------- |
|
|
193
|
+| function | No |
|
|
194
|
+
|
|
195
|
+---
|
|
196
|
+
|
181
|
197
|
### `onMessage`
|
182
|
198
|
|
183
|
199
|
A function that is invoked when the webview calls `window.postMessage`. Setting this property will inject a `postMessage` global into your webview, but will still call pre-existing values of `postMessage`.
|
|
@@ -266,8 +282,8 @@ Boolean value that forces the `WebView` to show the loading view on the first lo
|
266
|
282
|
|
267
|
283
|
A floating-point number that determines how quickly the scroll view decelerates after the user lifts their finger. You may also use the string shortcuts `"normal"` and `"fast"` which match the underlying iOS settings for `UIScrollViewDecelerationRateNormal` and `UIScrollViewDecelerationRateFast` respectively:
|
268
|
284
|
|
269
|
|
-* normal: 0.998
|
270
|
|
-* fast: 0.99 (the default for iOS web view)
|
|
285
|
+- normal: 0.998
|
|
286
|
+- fast: 0.99 (the default for iOS web view)
|
271
|
287
|
|
272
|
288
|
| Type | Required | Platform |
|
273
|
289
|
| ------ | -------- | -------- |
|
|
@@ -301,9 +317,9 @@ Specifies the mixed content mode. i.e WebView will allow a secure origin to load
|
301
|
317
|
|
302
|
318
|
Possible values for `mixedContentMode` are:
|
303
|
319
|
|
304
|
|
-* `never` (default) - WebView will not allow a secure origin to load content from an insecure origin.
|
305
|
|
-* `always` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.
|
306
|
|
-* `compatibility` - WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
|
|
320
|
+- `never` (default) - WebView will not allow a secure origin to load content from an insecure origin.
|
|
321
|
+- `always` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.
|
|
322
|
+- `compatibility` - WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
|
307
|
323
|
|
308
|
324
|
| Type | Required | Platform |
|
309
|
325
|
| ------ | -------- | -------- |
|
|
@@ -373,18 +389,18 @@ You can provide one type or an array of many types.
|
373
|
389
|
|
374
|
390
|
Possible values for `dataDetectorTypes` are:
|
375
|
391
|
|
376
|
|
-* `phoneNumber`
|
377
|
|
-* `link`
|
378
|
|
-* `address`
|
379
|
|
-* `calendarEvent`
|
380
|
|
-* `none`
|
381
|
|
-* `all`
|
|
392
|
+- `phoneNumber`
|
|
393
|
+- `link`
|
|
394
|
+- `address`
|
|
395
|
+- `calendarEvent`
|
|
396
|
+- `none`
|
|
397
|
+- `all`
|
382
|
398
|
|
383
|
399
|
With the [new WebKit](Reference.md#usewebkit) implementation, we have three new values:
|
384
|
400
|
|
385
|
|
-* `trackingNumber`
|
386
|
|
-* `flightNumber`
|
387
|
|
-* `lookupSuggestion`
|
|
401
|
+- `trackingNumber`
|
|
402
|
+- `flightNumber`
|
|
403
|
+- `lookupSuggestion`
|
388
|
404
|
|
389
|
405
|
| Type | Required | Platform |
|
390
|
406
|
| ---------------- | -------- | -------- |
|