mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8553e1acc4
Summary: We are rolling out exact-by-default syntax to xplat/js. I had to manually move around some comments to preserve proper placement. Changelog: [Internal] Reviewed By: jbrown215 Differential Revision: D18633611 fbshipit-source-id: 48f7468dcc55b1d00985419d035a61c6820b3abe
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const requireNativeComponent = require('../ReactNative/requireNativeComponent');
|
|
|
|
import codegenNativeComponent from '../Utilities/codegenNativeComponent';
|
|
|
|
import type {DangerouslyImpreciseStyle} from '../StyleSheet/StyleSheet';
|
|
import type {ResolvedAssetSource} from './AssetSourceResolver';
|
|
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
|
|
import type {ImageProps} from './ImageProps';
|
|
import type {ViewProps} from '../Components/View/ViewPropTypes';
|
|
import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
|
|
import type {ColorValue} from '../StyleSheet/StyleSheetTypes';
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ImageProps,
|
|
...ViewProps,
|
|
|
|
style?: ImageStyleProp | DangerouslyImpreciseStyle,
|
|
|
|
// iOS native props
|
|
tintColor?: ColorValue,
|
|
|
|
// Android native props
|
|
shouldNotifyLoadEvents?: boolean,
|
|
src?: ?ResolvedAssetSource | $ReadOnlyArray<{uri: string, ...}>,
|
|
headers?: ?string,
|
|
defaultSrc?: ?string,
|
|
loadingIndicatorSrc?: ?string,
|
|
|}>;
|
|
|
|
let ImageViewNativeComponent;
|
|
|
|
if (global.RN$Bridgeless) {
|
|
ImageViewNativeComponent = codegenNativeComponent<NativeProps>(
|
|
'RCTImageView',
|
|
);
|
|
} else {
|
|
ImageViewNativeComponent = requireNativeComponent<NativeProps>(
|
|
'RCTImageView',
|
|
);
|
|
}
|
|
|
|
module.exports = (ImageViewNativeComponent: HostComponent<NativeProps>);
|