Skip to content

Commit f76164f

Browse files
Titozzzfacebook-github-bot
authored andcommitted
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: #22980 Differential Revision: D13664505 Pulled By: hramos fbshipit-source-id: 0cfc06015e77c52bed9eeebd97c8cbca6eacd8ce
1 parent 991e83f commit f76164f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Libraries/react-native/react-native-implementation.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const invariant = require('invariant');
1414

1515
let showedListViewDeprecation = false;
1616
let showedSwipeableListViewDeprecation = false;
17+
let showedWebWiewDeprecation = false;
1718

1819
// Export React, plus some native additions.
1920
module.exports = {
@@ -167,6 +168,15 @@ module.exports = {
167168
return require('VirtualizedList');
168169
},
169170
get WebView() {
171+
if (!showedWebWiewDeprecation) {
172+
console.warn(
173+
'WebView has been extracted from react-native core and will be removed in a future release. ' +
174+
"It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " +
175+
'See https://github.com/react-native-community/react-native-webview for more informations.',
176+
);
177+
178+
showedWebWiewDeprecation = true;
179+
}
170180
return require('WebView');
171181
},
172182

0 commit comments

Comments
 (0)