From a62490808d22fa9fa36efaeefc25db52e6ae2066 Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 20 Jun 2019 18:24:31 -0700 Subject: [PATCH] Make ViewNativeComponent use ES6 exports Summary: We will need to use ES6 exports when we switch this to use the codegen'd view configs. I also need to have a named export from this file. Reviewed By: rickhanlonii Differential Revision: D15923789 fbshipit-source-id: 513e27834583b6d021ff06d5d7f116ccdcd27722 --- Libraries/Components/View/View.js | 4 +--- Libraries/Components/View/ViewNativeComponent.js | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 7d61e30a11..f40a7536b3 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -10,8 +10,6 @@ 'use strict'; -const ViewNativeComponent = require('./ViewNativeComponent'); - import type {ViewProps} from './ViewPropTypes'; export type Props = ViewProps; @@ -23,4 +21,4 @@ export type Props = ViewProps; * * @see http://facebook.github.io/react-native/docs/view.html */ -module.exports = ((ViewNativeComponent: $FlowFixMe): typeof ViewNativeComponent); +module.exports = require('./ViewNativeComponent').default; diff --git a/Libraries/Components/View/ViewNativeComponent.js b/Libraries/Components/View/ViewNativeComponent.js index 21e57c8a43..36a71deed9 100644 --- a/Libraries/Components/View/ViewNativeComponent.js +++ b/Libraries/Components/View/ViewNativeComponent.js @@ -18,6 +18,6 @@ import type {ViewProps} from './ViewPropTypes'; type ViewNativeComponentType = Class>; -const NativeViewComponent = requireNativeComponent('RCTView'); - -module.exports = ((NativeViewComponent: any): ViewNativeComponentType); +export default ((requireNativeComponent( + 'RCTView', +): any): ViewNativeComponentType);