mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Remove deprecated APIs and modules
Summary: We've deprecated these APIs for quite a few releases and we should be able to get rid of them now. Remove following deprecated modules/components - AppStateIOS - ActivityIndicatorIOS - IntentAndroid - SliderIOS - SwitchAndroid - SwitchIOS - LinkingIOS Update following modules to remove callback support - Clipboard - NetInfo cc bestander Closes https://github.com/facebook/react-native/pull/9891 Reviewed By: bestander Differential Revision: D3974094 Pulled By: javache fbshipit-source-id: 9abe32716bd85d0cea9933894f4447d53bdd5ee7
This commit is contained in:
committed by
Facebook Github Bot
parent
9ed9bca0bf
commit
fa5ad85252
@@ -16,7 +16,6 @@ const NativeEventEmitter = require('NativeEventEmitter');
|
||||
const NativeModules = require('NativeModules');
|
||||
const Platform = require('Platform');
|
||||
const RCTNetInfo = NativeModules.NetInfo;
|
||||
const deprecatedCallback = require('deprecatedCallback');
|
||||
|
||||
const NetInfoEventEmitter = new NativeEventEmitter(RCTNetInfo);
|
||||
|
||||
@@ -257,12 +256,9 @@ const NetInfo = {
|
||||
},
|
||||
},
|
||||
|
||||
isConnectionExpensive(): Promise<any> {
|
||||
return deprecatedCallback(
|
||||
Platform.OS === 'android' ? RCTNetInfo.isConnectionMetered() : Promise.reject(new Error('Currently not supported on iOS')),
|
||||
Array.prototype.slice.call(arguments),
|
||||
'single-callback-value-first',
|
||||
'NetInfo.isConnectionMetered(callback) is deprecated. Use the returned Promise instead.'
|
||||
isConnectionExpensive(): Promise<boolean> {
|
||||
return (
|
||||
Platform.OS === 'android' ? RCTNetInfo.isConnectionMetered() : Promise.reject(new Error('Currently not supported on iOS'))
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user