Skip to content

Commit 3618224

Browse files
NickGerlemanmeta-codesync[bot]
authored andcommitted
Remove TextInlineImageNativeComponent Remnants (#55434)
Summary: Pull Request resolved: #55434 This is used by `Image`, to render a different component when under a `TextAncestorContext`, but the underlying component is remapped by Fabric to instead be interpreted as `Image`. We can delete the code JS side safely, since it will use the existing registered View manager, Fabric will already redirect to. We can also then delete the redirection in Fabric, since the component is no longer ever used. See `componentNameByReactViewName.cpp`, where this is also removed. Changelog: [Internal] Reviewed By: mdvacca, javache, cortinico Differential Revision: D92481981 fbshipit-source-id: c33897efee124eaabed5447266389f34709650e0
1 parent 5d0d941 commit 3618224

3 files changed

Lines changed: 1 addition & 69 deletions

File tree

packages/react-native/Libraries/Image/Image.android.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import type {AbstractImageAndroid, ImageAndroid} from './ImageTypes.flow';
1818
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
1919
import flattenStyle from '../StyleSheet/flattenStyle';
2020
import StyleSheet from '../StyleSheet/StyleSheet';
21-
import TextAncestorContext from '../Text/TextAncestorContext';
2221
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
2322
import {
2423
unstable_getImageComponentDecorator,
@@ -31,7 +30,6 @@ import NativeImageLoaderAndroid, {
3130
type ImageSize,
3231
} from './NativeImageLoaderAndroid';
3332
import resolveAssetSource from './resolveAssetSource';
34-
import TextInlineImageNativeComponent from './TextInlineImageNativeComponent';
3533
import * as React from 'react';
3634
import {use} from 'react';
3735

@@ -326,24 +324,12 @@ let BaseImage: AbstractImageAndroid = ({
326324

327325
const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
328326

329-
const hasTextAncestor = use(TextAncestorContext);
330327
const analyticTag = use(ImageAnalyticsTagContext);
331328
if (analyticTag !== null) {
332329
nativeProps.internal_analyticTag = analyticTag;
333330
}
334331

335-
return hasTextAncestor ? (
336-
<TextInlineImageNativeComponent
337-
// $FlowFixMe[incompatible-type]
338-
style={style_}
339-
resizeMode={resizeMode_}
340-
headers={headers_}
341-
src={sources_}
342-
ref={actualRef}
343-
/>
344-
) : (
345-
<ImageViewNativeComponent {...nativeProps} ref={actualRef} />
346-
);
332+
return <ImageViewNativeComponent {...nativeProps} ref={actualRef} />;
347333
};
348334

349335
let _BaseImage = BaseImage;

packages/react-native/Libraries/Image/TextInlineImageNativeComponent.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

packages/react-native/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ std::string componentNameByReactViewName(std::string viewName) {
2828
return "Paragraph";
2929
}
3030

31-
// TODO T63839307: remove this condition after deleting TextInlineImage from
32-
// old renderer code
33-
if (viewName == "TextInlineImage") {
34-
return "Image";
35-
}
3631
if (viewName == "VirtualText") {
3732
return "Text";
3833
}

0 commit comments

Comments
 (0)