2018-08-09 01:34:26 +00:00
|
|
|
/**
|
|
|
|
* 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';
|
|
|
|
|
2018-08-23 19:46:43 +00:00
|
|
|
const AndroidConfig = require('ViewNativeComponentAndroidConfig');
|
2018-08-22 19:49:14 +00:00
|
|
|
const Platform = require('Platform');
|
2018-08-09 01:34:26 +00:00
|
|
|
const ReactNative = require('ReactNative');
|
|
|
|
|
2018-08-23 19:46:43 +00:00
|
|
|
const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence');
|
2018-08-09 01:34:26 +00:00
|
|
|
const requireNativeComponent = require('requireNativeComponent');
|
2018-08-22 19:49:14 +00:00
|
|
|
const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry');
|
2018-08-09 01:34:26 +00:00
|
|
|
|
|
|
|
import type {ViewProps} from 'ViewPropTypes';
|
|
|
|
|
|
|
|
type ViewNativeComponentType = Class<ReactNative.NativeComponent<ViewProps>>;
|
|
|
|
|
2018-08-22 19:49:14 +00:00
|
|
|
let NativeViewComponent;
|
2018-08-23 19:46:43 +00:00
|
|
|
if (Platform.OS === 'android') {
|
|
|
|
if (__DEV__) {
|
|
|
|
verifyComponentAttributeEquivalence('RCTView', AndroidConfig);
|
|
|
|
}
|
2018-08-09 01:34:26 +00:00
|
|
|
|
2018-08-22 19:49:14 +00:00
|
|
|
NativeViewComponent = ReactNativeViewConfigRegistry.register('RCTView', () =>
|
|
|
|
require('ViewNativeComponentAndroidConfig'),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
NativeViewComponent = requireNativeComponent('RCTView');
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = ((NativeViewComponent: any): ViewNativeComponentType);
|