From 781b637db4268ad7f5f3910d99ebb5203467840b Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Mon, 20 Nov 2023 18:10:55 -0800 Subject: [PATCH] Do not filter out Image.source prop when sending it C++ on New Architecture on Android (#41570) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41570 ## Changelog: [Internal] - This fixes a subtle problem whereas an update to `Image.source` (or `Image.src`) prop on JS side may not end up getting propagated to the C++ side, with New Architecture. As the result, this can lead to some weird corner cases, whereas e.g. layout doesn't update after the image's size changes. Differential Revision: D51479305 fbshipit-source-id: 72afb7dfd0ba32f96af4f9a6564b3b8121a597c7 --- .../react-native/Libraries/Image/ImageViewNativeComponent.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/Libraries/Image/ImageViewNativeComponent.js b/packages/react-native/Libraries/Image/ImageViewNativeComponent.js index c93c6d079eb..01459dddc05 100644 --- a/packages/react-native/Libraries/Image/ImageViewNativeComponent.js +++ b/packages/react-native/Libraries/Image/ImageViewNativeComponent.js @@ -90,6 +90,11 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = borderTopLeftRadius: true, resizeMethod: true, src: true, + // NOTE: New Architecture expects this to be called `source`, + // regardless of the platform, therefore propagate it as well. + // For the backwards compatibility reasons, we keep both `src` + // and `source`, which will be identical at this stage. + source: true, borderRadius: true, headers: true, shouldNotifyLoadEvents: true,