Files
react-native/Libraries/Image/ImageViewViewConfig.js
T
Peter Argany 80cfa9c8ee Handwritten view configs for Image
Summary:
Hand writing view configs for NativeImageViewComponent so that it'll work in bridgeless mode and won't fall back to the UIManager.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D19217961

fbshipit-source-id: d5a123b35a75ba3e22c57b1dde18a47893681614
2020-01-07 14:46:11 -08:00

68 lines
1.7 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';
import ReactNativeViewViewConfig from '../Components/View/ReactNativeViewViewConfig';
import type {ReactNativeBaseComponentViewConfig} from '../Renderer/shims/ReactNativeTypes';
const ImageViewViewConfig = {
uiViewClassName: 'RCTImageView',
bubblingEventTypes: {},
directEventTypes: {
topLoadStart: {
registrationName: 'onLoadStart',
},
topProgress: {
registrationName: 'onProgress',
},
topError: {
registrationName: 'onError',
},
topPartialLoad: {
registrationName: 'onPartialLoad',
},
topLoad: {
registrationName: 'onLoad',
},
topLoadEnd: {
registrationName: 'onLoadEnd',
},
},
validAttributes: {
...ReactNativeViewViewConfig.validAttributes,
blurRadius: true,
capInsets: {diff: (require('../Utilities/differ/insetsDiffer'): any)}, // flowlint-line unclear-type:off
defaultSource: {
process: require('./resolveAssetSource'),
},
defaultSrc: true,
fadeDuration: true,
headers: true,
loadingIndicatorSrc: true,
onError: true,
onLoad: true,
onLoadEnd: true,
onLoadStart: true,
onPartialLoad: true,
onProgress: true,
overlayColor: {process: require('../StyleSheet/processColor')},
progressiveRenderingEnabled: true,
resizeMethod: true,
resizeMode: true,
shouldNotifyLoadEvents: true,
source: true,
src: true,
tintColor: {process: require('../StyleSheet/processColor')},
},
};
module.exports = (ImageViewViewConfig: ReactNativeBaseComponentViewConfig<>);