Commit 17d1d2a
Fix crash when setting a percentage borderRadius on Image (Android)
Percentage border radii arrive from JS as strings ('50%'), but
ReactImageManager's borderRadius @ReactPropGroup setter still typed the
prop as Float, so the reflection-based property updater crashed with
"java.lang.String cannot be cast to java.lang.Double" under the new
architecture.
Accept a Dynamic and parse it with LengthPercentage.setFromDynamic,
mirroring the migration ReactViewManager received in 0.75. The Float
overload is kept as a deprecated pass-through for backward
compatibility. Rendering needs no changes since the manager already
delegates to BackgroundStyleApplicator, which resolves percentages.
Fixes #53977
Changelog:
[ANDROID] [FIXED] - Fix crash when setting a percentage borderRadius on Image
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015jdkybd1fVVGHCFk2EF2Q11 parent 63e9c15 commit 17d1d2a
4 files changed
Lines changed: 51 additions & 6 deletions
File tree
- packages
- react-native/ReactAndroid
- api
- src
- main/java/com/facebook/react/views/image
- test/java/com/facebook/react/views/image
- rn-tester/js/examples/Image
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5312 | 5312 | | |
5313 | 5313 | | |
5314 | 5314 | | |
| 5315 | + | |
5315 | 5316 | | |
5316 | 5317 | | |
5317 | 5318 | | |
| |||
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | | - | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
175 | 184 | | |
176 | 185 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 186 | + | |
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
145 | 174 | | |
146 | 175 | | |
147 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1189 | 1194 | | |
1190 | 1195 | | |
1191 | 1196 | | |
| |||
1448 | 1453 | | |
1449 | 1454 | | |
1450 | 1455 | | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
1451 | 1460 | | |
1452 | 1461 | | |
1453 | 1462 | | |
| |||
0 commit comments