Skip to content

Commit a12d9f9

Browse files
Nick Lefeverfacebook-github-bot
authored andcommitted
Fix image source size props in getDiffProps (facebook#51222)
Summary: Pull Request resolved: facebook#51222 The size parameters are flattened in the source object in the Android image component. This diff converts the `size` object to `width` and `height` props directly set on the source object, fixing image source setting more than one image source. Changelog: [Internal] Reviewed By: javache Differential Revision: D74477884 fbshipit-source-id: f6064b4222d5eeafd5d74f9a2044babedd1e291b
1 parent 3edc8d4 commit a12d9f9

File tree

1 file changed

+2
-4
lines changed
  • packages/react-native/ReactCommon/react/renderer/components/image

1 file changed

+2
-4
lines changed

packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,8 @@ static folly::dynamic convertImageSource(const ImageSource& imageSource) {
194194
imageSourceResult["bundle"] = imageSource.bundle;
195195
imageSourceResult["scale"] = imageSource.scale;
196196

197-
folly::dynamic size = folly::dynamic::object();
198-
size["width"] = imageSource.size.width;
199-
size["height"] = imageSource.size.height;
200-
imageSourceResult["size"] = size;
197+
imageSourceResult["width"] = imageSource.size.width;
198+
imageSourceResult["height"] = imageSource.size.height;
201199

202200
imageSourceResult["body"] = imageSource.body;
203201
imageSourceResult["method"] = imageSource.method;

0 commit comments

Comments
 (0)