Repository navigation
Commit 98d6795
Summary:
Pull Request resolved: #58863
On Android, props equal to their C++ default are not sent when a view is created, so each `ImageProps` default must describe the state a new image view starts in. Two defaults could not:
- `fadeDuration` defaulted to 300, while `ReactImageView` treats an unset duration as "no fade for local resources, 300ms for remote images". It is now a `std::optional<Float>` that is unset by default, the Android image request keeps using 300 when it is unset, and `ReactImageView` maps a removed `fadeDuration` back to unset instead of 0.
- `progressiveRenderingEnabled` defaulted to `false`, which image views that defer to the image pipeline's default never received when passed explicitly. It is now a `std::optional<bool>` that is unset by default; the Android image request keeps using `false` when it is unset.
Changelog:
[General][Breaking] - `ImageProps::fadeDuration` and `ImageProps::progressiveRenderingEnabled` are now `std::optional` in C++
[Android][Fixed] - Fix explicit `fadeDuration` being ignored on newly created `Image`s
Reviewed By: christophpurrer
Differential Revision: D123029512
fbshipit-source-id: 272a1ffaa32cc6cc6e37fb37975a64f480209c30
1 parent 2afaf3b commit 98d6795
13 files changed
Lines changed: 29 additions & 25 deletions
File tree
- packages/react-native
- ReactAndroid/src/main/java/com/facebook/react/views/image
- ReactCommon/react/renderer/components/image
- scripts/cxx-api/api-snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
253 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2573 | 2573 | | |
2574 | 2574 | | |
2575 | 2575 | | |
2576 | | - | |
2577 | 2576 | | |
2578 | 2577 | | |
2579 | 2578 | | |
2580 | | - | |
2581 | 2579 | | |
2582 | 2580 | | |
2583 | 2581 | | |
2584 | 2582 | | |
2585 | 2583 | | |
2586 | 2584 | | |
| 2585 | + | |
| 2586 | + | |
2587 | 2587 | | |
2588 | 2588 | | |
2589 | 2589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2555 | 2555 | | |
2556 | 2556 | | |
2557 | 2557 | | |
2558 | | - | |
2559 | 2558 | | |
2560 | 2559 | | |
2561 | 2560 | | |
2562 | | - | |
2563 | 2561 | | |
2564 | 2562 | | |
2565 | 2563 | | |
2566 | 2564 | | |
2567 | 2565 | | |
2568 | 2566 | | |
| 2567 | + | |
| 2568 | + | |
2569 | 2569 | | |
2570 | 2570 | | |
2571 | 2571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2570 | 2570 | | |
2571 | 2571 | | |
2572 | 2572 | | |
2573 | | - | |
2574 | 2573 | | |
2575 | 2574 | | |
2576 | 2575 | | |
2577 | | - | |
2578 | 2576 | | |
2579 | 2577 | | |
2580 | 2578 | | |
2581 | 2579 | | |
2582 | 2580 | | |
2583 | 2581 | | |
| 2582 | + | |
| 2583 | + | |
2584 | 2584 | | |
2585 | 2585 | | |
2586 | 2586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4954 | 4954 | | |
4955 | 4955 | | |
4956 | 4956 | | |
4957 | | - | |
4958 | 4957 | | |
4959 | 4958 | | |
4960 | 4959 | | |
4961 | | - | |
4962 | 4960 | | |
4963 | 4961 | | |
4964 | 4962 | | |
4965 | 4963 | | |
4966 | 4964 | | |
4967 | 4965 | | |
| 4966 | + | |
| 4967 | + | |
4968 | 4968 | | |
4969 | 4969 | | |
4970 | 4970 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4929 | 4929 | | |
4930 | 4930 | | |
4931 | 4931 | | |
4932 | | - | |
4933 | 4932 | | |
4934 | 4933 | | |
4935 | 4934 | | |
4936 | | - | |
4937 | 4935 | | |
4938 | 4936 | | |
4939 | 4937 | | |
4940 | 4938 | | |
4941 | 4939 | | |
4942 | 4940 | | |
| 4941 | + | |
| 4942 | + | |
4943 | 4943 | | |
4944 | 4944 | | |
4945 | 4945 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4951 | 4951 | | |
4952 | 4952 | | |
4953 | 4953 | | |
4954 | | - | |
4955 | 4954 | | |
4956 | 4955 | | |
4957 | 4956 | | |
4958 | | - | |
4959 | 4957 | | |
4960 | 4958 | | |
4961 | 4959 | | |
4962 | 4960 | | |
4963 | 4961 | | |
4964 | 4962 | | |
| 4963 | + | |
| 4964 | + | |
4965 | 4965 | | |
4966 | 4966 | | |
4967 | 4967 | | |
| |||
0 commit comments