Skip to content

Commit

Permalink
Added WebView deprecation warning (#22980)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Titozzz authored and facebook-github-bot committed Jan 15, 2019
1 parent 991e83f commit f76164f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Libraries/react-native/react-native-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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');
},

Expand Down

0 comments on commit f76164f

Please sign in to comment.