mirror of
https://github.com/status-im/react-native.git
synced 2025-01-17 21:11:45 +00:00
d0eb8ff858
Summary: Moving this config to native for android so we skip the native lookup for the config. Reviewed By: yungsters Differential Revision: D9415726 fbshipit-source-id: 84cac3f0dfa4f6ea8800de77676f1e2896ee463d
34 lines
914 B
JavaScript
34 lines
914 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const Platform = require('Platform');
|
|
const ReactNative = require('ReactNative');
|
|
|
|
const requireNativeComponent = require('requireNativeComponent');
|
|
const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry');
|
|
|
|
import type {ViewProps} from 'ViewPropTypes';
|
|
|
|
type ViewNativeComponentType = Class<ReactNative.NativeComponent<ViewProps>>;
|
|
|
|
let NativeViewComponent;
|
|
|
|
if (Platform.OS === 'Android') {
|
|
NativeViewComponent = ReactNativeViewConfigRegistry.register('RCTView', () =>
|
|
require('ViewNativeComponentAndroidConfig'),
|
|
);
|
|
} else {
|
|
NativeViewComponent = requireNativeComponent('RCTView');
|
|
}
|
|
|
|
module.exports = ((NativeViewComponent: any): ViewNativeComponentType);
|