diff --git a/Libraries/Components/StatusBar/StatusBarIOS.js b/Libraries/Components/StatusBar/StatusBarIOS.js deleted file mode 100644 index be8ee04add4faa..00000000000000 --- a/Libraries/Components/StatusBar/StatusBarIOS.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - * @flow strict-local - */ - -import NativeEventEmitter from '../../EventEmitter/NativeEventEmitter'; -import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS'; -import Platform from '../../Utilities/Platform'; - -type StatusBarFrameChangeEvent = { - frame: { - x: number, - y: number, - width: number, - height: number, - }, -}; - -type StatusBarIOSEventDefinitions = { - statusBarFrameDidChange: [StatusBarFrameChangeEvent], - statusBarFrameWillChange: [StatusBarFrameChangeEvent], -}; - -/** - * Use `StatusBar` for mutating the status bar. - */ -class StatusBarIOS extends NativeEventEmitter {} - -module.exports = (new StatusBarIOS( - // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior - // If you want to use the native module on other platforms, please remove this condition and test its behavior - Platform.OS !== 'ios' ? null : NativeStatusBarManagerIOS, -): StatusBarIOS); diff --git a/index.js b/index.js index 7f522811774ff0..545554b3b39ab0 100644 --- a/index.js +++ b/index.js @@ -77,7 +77,6 @@ import typeof PixelRatio from './Libraries/Utilities/PixelRatio'; import typeof PushNotificationIOS from './Libraries/PushNotificationIOS/PushNotificationIOS'; import typeof Settings from './Libraries/Settings/Settings'; import typeof Share from './Libraries/Share/Share'; -import typeof StatusBarIOS from './Libraries/Components/StatusBar/StatusBarIOS'; import typeof StyleSheet from './Libraries/StyleSheet/StyleSheet'; import typeof Systrace from './Libraries/Performance/Systrace'; import typeof ToastAndroid from './Libraries/Components/ToastAndroid/ToastAndroid'; @@ -384,13 +383,6 @@ module.exports = { get Share(): Share { return require('./Libraries/Share/Share'); }, - get StatusBarIOS(): StatusBarIOS { - warnOnce( - 'StatusBarIOS-merged', - 'StatusBarIOS has been merged with StatusBar and will be removed in a future release. Use StatusBar for mutating the status bar', - ); - return require('./Libraries/Components/StatusBar/StatusBarIOS'); - }, get StyleSheet(): StyleSheet { return require('./Libraries/StyleSheet/StyleSheet'); }, @@ -679,17 +671,17 @@ if (__DEV__) { }); /* $FlowFixMe[prop-missing] This is intentional: Flow will error when - * attempting to access Picker. */ + * attempting to access StatusBarIOS. */ /* $FlowFixMe[invalid-export] This is intentional: Flow will error when - * attempting to access Picker. */ - Object.defineProperty(module.exports, 'Picker', { + * attempting to access StatusBarIOS. */ + Object.defineProperty(module.exports, 'StatusBarIOS', { configurable: true, get() { invariant( false, - 'Picker has been removed from React Native. ' + - "It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " + - 'See https://github.com/react-native-picker/picker', + 'StatusBarIOS has been removed from React Native. ' + + 'Has been merged with StatusBar. ' + + 'See https://reactnative.dev/docs/statusbar', ); }, }); @@ -709,4 +701,20 @@ if (__DEV__) { ); }, }); + + /* $FlowFixMe[prop-missing] This is intentional: Flow will error when + * attempting to access Picker. */ + /* $FlowFixMe[invalid-export] This is intentional: Flow will error when + * attempting to access Picker. */ + Object.defineProperty(module.exports, 'Picker', { + configurable: true, + get() { + invariant( + false, + 'Picker has been removed from React Native. ' + + "It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " + + 'See https://github.com/react-native-picker/picker', + ); + }, + }); }