From 24b9b2dc375e56e25e8b1efb5a3b2920f19bab39 Mon Sep 17 00:00:00 2001 From: Chris Mitchell Date: Thu, 30 Aug 2018 16:47:55 +1200 Subject: [PATCH 1/2] Fixing Unhandled promise rejection on iOS WebView --- Libraries/Components/WebView/WebView.ios.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index 0ff52176f12aac..ca29a0ddbbb21b 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -487,7 +487,7 @@ class WebView extends React.Component { ); shouldStart = shouldStart && passesWhitelist; if (!passesWhitelist) { - Linking.openURL(url); + Linking.openURL(url).then(() => (/*ignored*/)).catch(() => (/*ignored*/)); } if (this.props.onShouldStartLoadWithRequest) { shouldStart = From 1bd6b676572b66d2c09c2b7765cb8ca98bba8564 Mon Sep 17 00:00:00 2001 From: Chris Mitchell Date: Thu, 30 Aug 2018 18:53:51 +1200 Subject: [PATCH 2/2] Fix linting --- Libraries/Components/WebView/WebView.ios.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index ca29a0ddbbb21b..f23baea2b18be3 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -487,7 +487,13 @@ class WebView extends React.Component { ); shouldStart = shouldStart && passesWhitelist; if (!passesWhitelist) { - Linking.openURL(url).then(() => (/*ignored*/)).catch(() => (/*ignored*/)); + Linking.openURL(url) + .then(() => { + //ignored + }) + .catch(() => { + //ignored + }); } if (this.props.onShouldStartLoadWithRequest) { shouldStart =