From 96334d31edb91bce7c3f5fe27650f246c96e43ee Mon Sep 17 00:00:00 2001 From: Thibault Malbranche Date: Wed, 20 Mar 2019 12:25:36 +0000 Subject: [PATCH] last test --- src/WebView.android.tsx | 22 +++++++++------------- src/WebView.ios.tsx | 2 +- src/WebViewTypes.ts | 4 ---- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/WebView.android.tsx b/src/WebView.android.tsx index b011a67..1ce6840 100644 --- a/src/WebView.android.tsx +++ b/src/WebView.android.tsx @@ -254,18 +254,14 @@ class WebView extends React.Component { webViewStyles.push(styles.hidden); } - if ( - (source as WebViewUriSource).method === 'POST' - && (source as WebViewUriSource).headers - ) { - console.warn( - 'WebView: `source.headers` is not supported when using POST.', - ); - } else if ( - (source as WebViewUriSource).method === 'GET' - && (source as WebViewUriSource).body - ) { - console.warn('WebView: `source.body` is not supported when using GET.'); + if (source && 'method' in source) { + if (source.method === 'POST' && source.headers) { + console.warn( + 'WebView: `source.headers` is not supported when using POST.', + ); + } else if (source.method === 'GET' && source.body) { + console.warn('WebView: `source.body` is not supported when using GET.'); + } } const NativeWebView @@ -280,8 +276,8 @@ class WebView extends React.Component { const webView = ( { const webView = ( ; }