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
This commit is contained in:
Eli White 2019-06-20 18:24:31 -07:00 коммит произвёл Facebook Github Bot
Родитель 28f1aac88c
Коммит a62490808d
2 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -18,6 +18,6 @@ import type {ViewProps} from './ViewPropTypes';
type ViewNativeComponentType = Class<ReactNative.NativeComponent<ViewProps>>;
const NativeViewComponent = requireNativeComponent('RCTView');
module.exports = ((NativeViewComponent: any): ViewNativeComponentType);
export default ((requireNativeComponent(
'RCTView',
): any): ViewNativeComponentType);