Skip to content

Commit 7124249

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Remove TextInlineImageNativeComponent in JS (facebook#55434)
Summary: 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
1 parent c51b969 commit 7124249

File tree

3 files changed

+1
-69
lines changed

3 files changed

+1
-69
lines changed

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import type {AbstractImageAndroid, ImageAndroid} from './ImageTypes.flow';
1717

1818
import flattenStyle from '../StyleSheet/flattenStyle';
1919
import StyleSheet from '../StyleSheet/StyleSheet';
20-
import TextAncestorContext from '../Text/TextAncestorContext';
2120
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
2221
import {
2322
unstable_getImageComponentDecorator,
@@ -30,7 +29,6 @@ import NativeImageLoaderAndroid, {
3029
type ImageSize,
3130
} from './NativeImageLoaderAndroid';
3231
import resolveAssetSource from './resolveAssetSource';
33-
import TextInlineImageNativeComponent from './TextInlineImageNativeComponent';
3432
import * as React from 'react';
3533
import {use} from 'react';
3634

@@ -309,24 +307,12 @@ let BaseImage: AbstractImageAndroid = ({
309307

310308
const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
311309

312-
const hasTextAncestor = use(TextAncestorContext);
313310
const analyticTag = use(ImageAnalyticsTagContext);
314311
if (analyticTag !== null) {
315312
nativeProps.internal_analyticTag = analyticTag;
316313
}
317314

318-
return hasTextAncestor ? (
319-
<TextInlineImageNativeComponent
320-
// $FlowFixMe[incompatible-type]
321-
style={style_}
322-
resizeMode={resizeMode_}
323-
headers={headers_}
324-
src={sources_}
325-
ref={actualRef}
326-
/>
327-
) : (
328-
<ImageViewNativeComponent {...nativeProps} ref={actualRef} />
329-
);
315+
return <ImageViewNativeComponent {...nativeProps} ref={actualRef} />;
330316
};
331317

332318
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)