Skip to content

Conversation

@hannojg
Copy link
Contributor

@hannojg hannojg commented Feb 11, 2026

Summary:

In our app we are using the props 2.0 diffing mechanism (ie getDiffProps in cpp).
I noticed that our <Image source={...} fadeDuration={0} /> were still showing with the default 300ms fade duration.

The issue is that we instantiate the fadeDuration in cpp with a default value of 0:

and then in the props diff implementation when comparing our prop value of 0 against the default, it will not be added to the final props, thus never set in the native image view:

if (fadeDuration != oldProps->fadeDuration) {
result["fadeDuration"] = fadeDuration;
}

The native image view uses a default value of -1 so i thought to use the same here:

Another solution could be to type the fadeDuration as std::optional, let me know what you prefer

Changelog:

[ANDROID] [FIXED] - Image fadeDuration=0 not working with props 2.0 enabled

Test Plan:

You can enable the props 2.0 feature flags in the RNTesterApp and check the image example!

@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 Feb 11, 2026
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Feb 11, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 11, 2026

@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D92964613.

@meta-codesync meta-codesync bot closed this in 3fb5c0b Feb 11, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 11, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 11, 2026

@fabriziocucci merged this pull request in 3fb5c0b.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @hannojg in 3fb5c0b

When will my fix make it into a release? | How to file a pick request?

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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants