Skip to content

Commit

Permalink
Add a deprecation warning when importing NetInfo (#23383)
Browse files Browse the repository at this point in the history
Summary:
Add a deprecation warning for the `NetInfo` module as part of #23313.

[General] [Deprecated] - Deprecated NetInfo as it has now been moved to react-native-community/netinfo
Pull Request resolved: #23383

Differential Revision: D14024702

Pulled By: cpojer

fbshipit-source-id: 353a9fb86feba2ca7f948c618c642e40fcdbfada
  • Loading branch information
matt-oakes authored and facebook-github-bot committed Feb 11, 2019
1 parent bf888a7 commit d9c0dfe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Libraries/react-native/react-native-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ module.exports = {
'webview-moved',
'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.',
'See https://github.com/react-native-community/react-native-webview',
);
return require('WebView');
},
Expand Down Expand Up @@ -252,6 +252,12 @@ module.exports = {
return require('NativeEventEmitter');
},
get NetInfo() {
warnOnce(
'netinfo-moved',
'NetInfo 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-community/netinfo' instead of 'react-native'. " +
'See https://github.com/react-native-community/react-native-netinfo',
);
return require('NetInfo');
},
get PanResponder() {
Expand Down

0 comments on commit d9c0dfe

Please sign in to comment.