From 5689302a6ae9c2793109b5dfd3d9299fc597dcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 14 Jun 2019 03:10:54 -0700 Subject: [PATCH] Add RTCSafeAreaView Summary: Adds codegen component for RTCSafeAreaView(NativeComponent). Reviewed By: rickhanlonii Differential Revision: D15804215 fbshipit-source-id: 103312aecb35029d05412b70829dbe4668ba7768 --- .../RCTSafeAreaViewNativeComponent.js | 18 +++++++++--------- .../Components/SafeAreaView/SafeAreaView.js | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) 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,