|
@@ -254,18 +254,14 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
|
254
|
254
|
webViewStyles.push(styles.hidden);
|
255
|
255
|
}
|
256
|
256
|
|
257
|
|
- if (
|
258
|
|
- (source as WebViewUriSource).method === 'POST'
|
259
|
|
- && (source as WebViewUriSource).headers
|
260
|
|
- ) {
|
261
|
|
- console.warn(
|
262
|
|
- 'WebView: `source.headers` is not supported when using POST.',
|
263
|
|
- );
|
264
|
|
- } else if (
|
265
|
|
- (source as WebViewUriSource).method === 'GET'
|
266
|
|
- && (source as WebViewUriSource).body
|
267
|
|
- ) {
|
268
|
|
- console.warn('WebView: `source.body` is not supported when using GET.');
|
|
257
|
+ if (source && 'method' in source) {
|
|
258
|
+ if (source.method === 'POST' && source.headers) {
|
|
259
|
+ console.warn(
|
|
260
|
+ 'WebView: `source.headers` is not supported when using POST.',
|
|
261
|
+ );
|
|
262
|
+ } else if (source.method === 'GET' && source.body) {
|
|
263
|
+ console.warn('WebView: `source.body` is not supported when using GET.');
|
|
264
|
+ }
|
269
|
265
|
}
|
270
|
266
|
|
271
|
267
|
const NativeWebView
|
|
@@ -280,8 +276,8 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
|
280
|
276
|
|
281
|
277
|
const webView = (
|
282
|
278
|
<NativeWebView
|
283
|
|
- {...otherProps}
|
284
|
279
|
key="webViewKey"
|
|
280
|
+ {...otherProps}
|
285
|
281
|
messagingEnabled={typeof onMessage === 'function'}
|
286
|
282
|
onLoadingError={this.onLoadingError}
|
287
|
283
|
onLoadingFinish={this.onLoadingFinish}
|