Skip to content

Commit ad43eec

Browse files
committed
Keep fastAddProperties only in ReactNativeAttributePayloadFabric
1 parent 573c608 commit ad43eec

File tree

1 file changed

+2
-68
lines changed

1 file changed

+2
-68
lines changed

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

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
import isArray from 'shared/isArray';
1616

1717
import {enableEarlyReturnForPropDiffing} from 'shared/ReactFeatureFlags';
18-
import {enableAddPropertiesFastPath} from 'shared/ReactFeatureFlags';
1918

2019
import type {AttributeConfiguration} from './ReactNativeTypes';
2120

@@ -445,68 +444,6 @@ function diffProperties(
445444
return updatePayload;
446445
}
447446

448-
function fastAddProperties(
449-
updatePayload: null | Object,
450-
nextProps: Object,
451-
validAttributes: AttributeConfiguration,
452-
): null | Object {
453-
let attributeConfig;
454-
let nextProp;
455-
456-
for (const propKey in nextProps) {
457-
nextProp = nextProps[propKey];
458-
459-
if (nextProp === undefined) {
460-
continue;
461-
}
462-
463-
attributeConfig = validAttributes[propKey];
464-
465-
if (attributeConfig === undefined) {
466-
continue;
467-
}
468-
469-
if (typeof nextProp === 'function') {
470-
nextProp = (true: any);
471-
}
472-
473-
if (typeof attributeConfig !== 'object') {
474-
if (!updatePayload) {
475-
updatePayload = ({}: {[string]: $FlowFixMe});
476-
}
477-
updatePayload[propKey] = nextProp;
478-
continue;
479-
}
480-
481-
if (typeof attributeConfig.process === 'function') {
482-
if (!updatePayload) {
483-
updatePayload = ({}: {[string]: $FlowFixMe});
484-
}
485-
updatePayload[propKey] = attributeConfig.process(nextProp);
486-
continue;
487-
}
488-
489-
if (isArray(nextProp)) {
490-
for (let i = 0; i < nextProp.length; i++) {
491-
updatePayload = fastAddProperties(
492-
updatePayload,
493-
nextProp[i],
494-
((attributeConfig: any): AttributeConfiguration),
495-
);
496-
}
497-
continue;
498-
}
499-
500-
updatePayload = fastAddProperties(
501-
updatePayload,
502-
nextProp,
503-
((attributeConfig: any): AttributeConfiguration),
504-
);
505-
}
506-
507-
return updatePayload;
508-
}
509-
510447
/**
511448
* addProperties adds all the valid props to the payload after being processed.
512449
*/
@@ -515,11 +452,8 @@ function addProperties(
515452
props: Object,
516453
validAttributes: AttributeConfiguration,
517454
): null | Object {
518-
if (enableAddPropertiesFastPath) {
519-
return fastAddProperties(updatePayload, props, validAttributes);
520-
} else {
521-
return diffProperties(updatePayload, emptyObject, props, validAttributes);
522-
}
455+
// TODO: Fast path
456+
return diffProperties(updatePayload, emptyObject, props, validAttributes);
523457
}
524458

525459
/**

0 commit comments

Comments
 (0)