From f76164f88ac127546e26d5fa47aba488d96e9b5b Mon Sep 17 00:00:00 2001 From: Thibault Malbranche Date: Mon, 14 Jan 2019 16:50:15 -0800 Subject: [PATCH] Added WebView deprecation warning (#22980) Summary: Changelog: ---------- Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example. [General] [Deprecated] - Deprecation warning for WebView as it has been extracted from core. Pull Request resolved: https://github.com/facebook/react-native/pull/22980 Differential Revision: D13664505 Pulled By: hramos fbshipit-source-id: 0cfc06015e77c52bed9eeebd97c8cbca6eacd8ce --- Libraries/react-native/react-native-implementation.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Libraries/react-native/react-native-implementation.js b/Libraries/react-native/react-native-implementation.js index 98a2f3887..059a3be33 100644 --- a/Libraries/react-native/react-native-implementation.js +++ b/Libraries/react-native/react-native-implementation.js @@ -14,6 +14,7 @@ const invariant = require('invariant'); let showedListViewDeprecation = false; let showedSwipeableListViewDeprecation = false; +let showedWebWiewDeprecation = false; // Export React, plus some native additions. module.exports = { @@ -167,6 +168,15 @@ module.exports = { return require('VirtualizedList'); }, get WebView() { + if (!showedWebWiewDeprecation) { + console.warn( + 'WebView has been extracted from react-native core and will be removed in a future release. ' + + "It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " + + 'See https://github.com/react-native-community/react-native-webview for more informations.', + ); + + showedWebWiewDeprecation = true; + } return require('WebView'); },