@@ -14,9 +14,9 @@ import {
1414} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ;
1515import isArray from 'shared/isArray' ;
1616
17- import { enableShallowPropDiffing } from 'shared/ReactFeatureFlags' ;
17+ import { enableShallowPropDiffing } from 'shared/ReactFeatureFlags' ;
1818
19- import type { AttributeConfiguration } from './ReactNativeTypes' ;
19+ import type { AttributeConfiguration } from './ReactNativeTypes' ;
2020
2121const emptyObject = { } ;
2222
@@ -32,7 +32,7 @@ const emptyObject = {};
3232type NestedNode = Array < NestedNode > | Object ;
3333
3434// Tracks removed keys
35- let removedKeys : { [ string ] : boolean } | null = null ;
35+ let removedKeys : { [ string ] : boolean } | null = null ;
3636let removedKeyCount = 0 ;
3737
3838const deepDifferOptions = {
@@ -344,7 +344,7 @@ function diffProperties(
344344 // case: !Object is the default case
345345 if ( enableShallowPropDiffing || defaultDiffer ( prevProp , nextProp ) ) {
346346 // a normal leaf has changed
347- ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
347+ ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
348348 propKey
349349 ] = nextProp ;
350350 }
@@ -363,9 +363,9 @@ function diffProperties(
363363 const nextValue =
364364 typeof attributeConfig . process === 'function'
365365 ? // $FlowFixMe[incompatible-use] found when upgrading Flow
366- attributeConfig . process ( nextProp )
366+ attributeConfig . process ( nextProp )
367367 : nextProp ;
368- ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
368+ ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
369369 propKey
370370 ] = nextValue ;
371371 }
@@ -421,11 +421,11 @@ function diffProperties(
421421 ) {
422422 // case: CustomAttributeConfiguration | !Object
423423 // Flag the leaf property for removal by sending a sentinel.
424- ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
424+ ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
425425 propKey
426426 ] = null ;
427427 if ( ! removedKeys ) {
428- removedKeys = ( { } : { [ string ] : boolean } ) ;
428+ removedKeys = ( { } : { [ string ] : boolean } ) ;
429429 }
430430 if ( ! removedKeys [ propKey ] ) {
431431 removedKeys [ propKey ] = true ;
@@ -478,7 +478,7 @@ function fastAddProperties(
478478 } else {
479479 continue ;
480480 }
481- } else if ( typeof attributeConfig . process === 'function' ) {
481+ } else if ( typeof attributeConfig === 'object' && typeof attributeConfig . process === 'function' ) {
482482 // An atomic prop with custom processing.
483483 newValue = attributeConfig . process ( prop ) ;
484484 } else if ( typeof prop === 'function' ) {
@@ -494,7 +494,7 @@ function fastAddProperties(
494494
495495 if ( newValue !== undefined ) {
496496 if ( ! payload ) {
497- payload = ( { } : { [ string ] : $FlowFixMe } ) ;
497+ payload = ( { } : { [ string ] : $FlowFixMe } ) ;
498498 }
499499 payload [ propKey ] = newValue ;
500500 continue ;
0 commit comments