Skip to content

Commit

Permalink
Run the enableAccumulatedUpdatesInRawPropsAndroid QE for View only
Browse files Browse the repository at this point in the history
Summary:
The `enableAccumulatedUpdatesInRawPropsAndroid` param will be tested together with the `enablePropsUpdateReconciliationAndroid` param.

`enablePropsUpdateReconciliationAndroid` currently only supports `View` components.

This diff changes `enableAccumulatedUpdatesInRawPropsAndroid`  to also run only for `View`s.

Differential Revision: D68492332
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Jan 22, 2025
1 parent ce41274 commit c11fe68
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,20 @@ jni::local_ref<jobject> getProps(
// and the Props of the latest commited ShadowTree). ONLY for <View>
// components when the "enablePropsUpdateReconciliationAndroid" feature flag
// is enabled.
auto* oldProps = oldShadowView.props.get();
auto* newProps = newShadowView.props.get();
if (ReactNativeFeatureFlags::enablePropsUpdateReconciliationAndroid() &&
strcmp(newShadowView.componentName, "View") == 0) {
return ReadableNativeMap::newObjectCxxArgs(
newProps->getDiffProps(oldProps));
}
if (ReactNativeFeatureFlags::enableAccumulatedUpdatesInRawPropsAndroid()) {
if (oldProps == nullptr) {
return ReadableNativeMap::newObjectCxxArgs(newProps->rawProps);
} else {
if (strcmp(newShadowView.componentName, "View") == 0) {
auto* oldProps = oldShadowView.props.get();
if (ReactNativeFeatureFlags::enablePropsUpdateReconciliationAndroid()) {
return ReadableNativeMap::newObjectCxxArgs(
diffDynamicProps(oldProps->rawProps, newProps->rawProps));
newProps->getDiffProps(oldProps));
}
if (ReactNativeFeatureFlags::enableAccumulatedUpdatesInRawPropsAndroid()) {
if (oldProps == nullptr) {
return ReadableNativeMap::newObjectCxxArgs(newProps->rawProps);
} else {
return ReadableNativeMap::newObjectCxxArgs(
diffDynamicProps(oldProps->rawProps, newProps->rawProps));
}
}
}
return ReadableNativeMap::newObjectCxxArgs(newProps->rawProps);
Expand Down

0 comments on commit c11fe68

Please sign in to comment.