Skip to content

Commit 0038c50

Browse files
authored
[react-native] Pull up enableFastAddPropertiesInDiffing check (facebook#33043)
## Summary We don't need the isArray check for this experiment, as `fastAddProperties` already does the same. Also renaming slowAddProperties to make it clearer we can fully remove this codepath once fastAddProperties is fully rolled out. ## How did you test this change? ``` yarn test packages/react-native-renderer -r=xplat --variant=true ```
1 parent 5dc00d6 commit 0038c50

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ function addNestedProperty(
219219
return updatePayload;
220220
}
221221

222+
if (enableFastAddPropertiesInDiffing) {
223+
return fastAddProperties(updatePayload, nextProp, validAttributes);
224+
}
225+
222226
if (!isArray(nextProp)) {
223227
// Add each property of the leaf.
224-
if (enableFastAddPropertiesInDiffing) {
225-
return fastAddProperties(updatePayload, nextProp, validAttributes);
226-
} else {
227-
return addProperties(updatePayload, nextProp, validAttributes);
228-
}
228+
return slowAddProperties(updatePayload, nextProp, validAttributes);
229229
}
230230

231231
for (let i = 0; i < nextProp.length; i++) {
@@ -516,7 +516,7 @@ function fastAddProperties(
516516
/**
517517
* addProperties adds all the valid props to the payload after being processed.
518518
*/
519-
function addProperties(
519+
function slowAddProperties(
520520
updatePayload: null | Object,
521521
props: Object,
522522
validAttributes: AttributeConfiguration,

0 commit comments

Comments
 (0)