Commit 45b177f
fix: height and width added back in props (#47044)
Summary:
Fixes this: #41151
## Changelog:
[GENERAL] [FIXED] - Passed height and width as native props to support cases where source is an array.
**Issue**: Unable to use height and width as props in Image components when passing source as an array.
This functionality worked before this [commit](#34481). In Image.android.js and Image.ios.js, height and width props are extracted before passing them to the native side. This extraction makes these props ineffective when passed directly. Although setting height and width in style is a workaround, these props should still be respected since they exist for this purpose.
The issue occurs only when the source prop is an array. When source is an object, width and height are manually passed to the style object, so the issue doesn't arise.
Pull Request resolved: #47044
Test Plan: Tested this on `rn-tester` app
Reviewed By: necolas, javache
Differential Revision: D64458292
Pulled By: cipolleschi
fbshipit-source-id: 5cacad79b8d4468a4a1fd0977221e42ce4b2e5d11 parent b0f0f06 commit 45b177f
File tree
2 files changed
+1
-5
lines changed- packages/react-native/Libraries/Image
2 files changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | 169 | | |
172 | 170 | | |
173 | | - | |
| 171 | + | |
174 | 172 | | |
175 | 173 | | |
176 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | 148 | | |
150 | | - | |
151 | 149 | | |
152 | 150 | | |
153 | 151 | | |
| |||
0 commit comments