diff --git a/packages/react-native/Libraries/Image/Image.android.js b/packages/react-native/Libraries/Image/Image.android.js index 998270b1cfc..08fbe9d1fac 100644 --- a/packages/react-native/Libraries/Image/Image.android.js +++ b/packages/react-native/Libraries/Image/Image.android.js @@ -133,7 +133,6 @@ let BaseImage: AbstractImageAndroid = React.forwardRef( width: undefined, height: undefined, }; - const defaultSource = resolveAssetSource(props.defaultSource); const loadingIndicatorSource = resolveAssetSource( props.loadingIndicatorSource, ); @@ -179,7 +178,6 @@ let BaseImage: AbstractImageAndroid = React.forwardRef( /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found * when making Flow check .android.js files. */ headers: (source?.[0]?.headers || source?.headers: ?{[string]: string}), - defaultSrc: defaultSource ? defaultSource.uri : null, loadingIndicatorSrc: loadingIndicatorSource ? loadingIndicatorSource.uri : null, diff --git a/packages/react-native/Libraries/Image/ImageViewNativeComponent.js b/packages/react-native/Libraries/Image/ImageViewNativeComponent.js index 69680c4f3dd..22ac430c219 100644 --- a/packages/react-native/Libraries/Image/ImageViewNativeComponent.js +++ b/packages/react-native/Libraries/Image/ImageViewNativeComponent.js @@ -82,6 +82,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = }, validAttributes: { blurRadius: true, + defaultSource: { + process: require('./resolveAssetSource'), + }, internal_analyticTag: true, resizeMethod: true, resizeMode: true, @@ -100,7 +103,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = borderRadius: true, headers: true, shouldNotifyLoadEvents: true, - defaultSrc: true, overlayColor: { process: require('../StyleSheet/processColor').default, }, diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.kt index 77e1d986655..63942f03f6e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.kt @@ -124,8 +124,7 @@ public constructor( } } - // In JS this is Image.props.defaultSource - @ReactProp(name = "defaultSrc") + @ReactProp(name = "defaultSource") public fun setDefaultSource(view: ReactImageView, source: String?) { view.setDefaultSource(source) }