Refactor Image to log component stacktraces for images rendering non-fb sources

Summary:
This diff refactors the Image component in order to log the component hierarchy stacktraces for images rendering non-fb sources

Changelog: [Internal] internal

Reviewed By: fkgozali

Differential Revision: D30504483

fbshipit-source-id: 1e41a67d5b9643730360bce7e787ee3427d931e8
This commit is contained in:
Keion Anvaripour
2021-08-25 16:41:50 -07:00
committed by Facebook GitHub Bot
parent 2abacace54
commit 8da6964d80
+6
View File
@@ -12,6 +12,7 @@ import DeprecatedImagePropType from '../DeprecatedPropTypes/DeprecatedImagePropT
import * as React from 'react';
import StyleSheet from '../StyleSheet/StyleSheet';
import ImageInjection from './ImageInjection';
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
import flattenStyle from '../StyleSheet/flattenStyle';
import resolveAssetSource from './resolveAssetSource';
@@ -168,6 +169,11 @@ Image = React.forwardRef<
ImagePropsType,
React.ElementRef<typeof ImageViewNativeComponent>,
>(Image);
if (ImageInjection.unstable_createImageComponent != null) {
Image = ImageInjection.unstable_createImageComponent(Image);
}
Image.displayName = 'Image';
/**