diff --git a/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js b/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js index b7b146b7d3c..6d51c187f60 100644 --- a/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +++ b/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js @@ -5,21 +5,21 @@ * LICENSE file in the root directory of this source tree. * * @format - * @flow + * @flow strict-local */ -const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); +'use strict'; import type {ViewProps} from '../View/ViewPropTypes'; -import type {NativeComponent} from '../../Renderer/shims/ReactNative'; +import type {WithDefault} from '../../Types/CodegenTypes'; + +import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; type NativeProps = $ReadOnly<{| ...ViewProps, - emulateUnlessSupported?: boolean, + + // Props + emulateUnlessSupported?: WithDefault, |}>; -type RCTSafeAreaViewNativeType = Class>; - -module.exports = ((requireNativeComponent( - 'RCTSafeAreaView', -): any): RCTSafeAreaViewNativeType); +export default codegenNativeComponent('RCTSafeAreaView'); diff --git a/Libraries/Components/SafeAreaView/SafeAreaView.js b/Libraries/Components/SafeAreaView/SafeAreaView.js index b9c157df9da..61be02b030e 100644 --- a/Libraries/Components/SafeAreaView/SafeAreaView.js +++ b/Libraries/Components/SafeAreaView/SafeAreaView.js @@ -44,7 +44,8 @@ if (Platform.OS === 'android') { SafeAreaViewRef.displayName = 'SafeAreaView'; exported = ((SafeAreaViewRef: any): Class>); } else { - const RCTSafeAreaViewNativeComponent = require('./RCTSafeAreaViewNativeComponent'); + const RCTSafeAreaViewNativeComponent = require('./RCTSafeAreaViewNativeComponent') + .default; const SafeAreaView = ( props: Props,