react-native/Libraries/Image/ImageViewNativeComponent.js
Eli White a700044e2e Move Android's Image ViewConfig to JS
Reviewed By: sahrens

Differential Revision: D9492683

fbshipit-source-id: 035aa00650ee4908452fe18384d953882bc2a8d8
2018-08-23 21:48:04 -07:00

35 lines
972 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 AndroidConfig = require('ImageViewNativeComponentAndroidConfig');
const Platform = require('Platform');
const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence');
const requireNativeComponent = require('requireNativeComponent');
const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry');
let ImageViewNativeComponent;
if (Platform.OS === 'android') {
if (__DEV__) {
verifyComponentAttributeEquivalence('RCTImageView', AndroidConfig);
}
ImageViewNativeComponent = ReactNativeViewConfigRegistry.register(
'RCTImageView',
() => AndroidConfig,
);
} else {
ImageViewNativeComponent = requireNativeComponent('RCTImageView');
}
module.exports = ImageViewNativeComponent;