From 8da6964d80ecbdcd2baf1c10db05d67e068d9a49 Mon Sep 17 00:00:00 2001 From: Keion Anvaripour Date: Wed, 25 Aug 2021 16:40:31 -0700 Subject: [PATCH] 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 --- Libraries/Image/Image.ios.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 5cadc1db9dcbbb..3dab5cc8c1f7f0 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -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, >(Image); + +if (ImageInjection.unstable_createImageComponent != null) { + Image = ImageInjection.unstable_createImageComponent(Image); +} + Image.displayName = 'Image'; /**