Skip to content

Make Image fadeDuration and progressiveRenderingEnabled optional in C++ - #58863

Closed
bartlomiejbloniarz wants to merge 1 commit into
mainfrom
export-D123029512
Closed

bartlomiejbloniarz wants to merge 1 commit into
mainfrom
export-D123029512

Conversation

@bartlomiejbloniarz

Copy link
Copy Markdown
Contributor

Summary:
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 Images

Differential Revision: D123029512

…in C++

Summary:
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

Differential Revision: D123029512
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 5, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Oct 5, 2026
@meta-codesync

meta-codesync Bot commented Oct 5, 2026

Copy link
Copy Markdown

@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D123029512.

@bartlomiejbloniarz bartlomiejbloniarz added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner p: Software Mansion Partner: Software Mansion meta-exported labels Oct 5, 2026
@meta-codesync meta-codesync Bot closed this in 98d6795 Oct 6, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 6, 2026
@meta-codesync

meta-codesync Bot commented Oct 6, 2026

Copy link
Copy Markdown

This pull request has been merged in 98d6795.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant