@@ -12,6 +12,7 @@ import {
12
12
deepDiffer ,
13
13
flattenStyle ,
14
14
} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ;
15
+ import isArray from 'shared/isArray' ;
15
16
16
17
import type { AttributeConfiguration } from './ReactNativeTypes' ;
17
18
@@ -51,7 +52,7 @@ function restoreDeletedValuesInNestedArray(
51
52
node : NestedNode ,
52
53
validAttributes : AttributeConfiguration ,
53
54
) {
54
- if ( Array . isArray ( node ) ) {
55
+ if ( isArray ( node ) ) {
55
56
let i = node . length ;
56
57
while ( i -- && removedKeyCount > 0 ) {
57
58
restoreDeletedValuesInNestedArray (
@@ -163,12 +164,12 @@ function diffNestedProperty(
163
164
return updatePayload ;
164
165
}
165
166
166
- if ( ! Array . isArray ( prevProp ) && ! Array . isArray ( nextProp ) ) {
167
+ if ( ! isArray ( prevProp ) && ! isArray ( nextProp ) ) {
167
168
// Both are leaves, we can diff the leaves.
168
169
return diffProperties ( updatePayload , prevProp , nextProp , validAttributes ) ;
169
170
}
170
171
171
- if ( Array . isArray ( prevProp ) && Array . isArray ( nextProp ) ) {
172
+ if ( isArray ( prevProp ) && isArray ( nextProp ) ) {
172
173
// Both are arrays, we can diff the arrays.
173
174
return diffNestedArrayProperty (
174
175
updatePayload ,
@@ -178,7 +179,7 @@ function diffNestedProperty(
178
179
) ;
179
180
}
180
181
181
- if ( Array . isArray ( prevProp ) ) {
182
+ if ( isArray ( prevProp ) ) {
182
183
return diffProperties (
183
184
updatePayload ,
184
185
// $FlowFixMe - We know that this is always an object when the input is.
@@ -212,7 +213,7 @@ function addNestedProperty(
212
213
return updatePayload ;
213
214
}
214
215
215
- if ( ! Array . isArray ( nextProp ) ) {
216
+ if ( ! isArray ( nextProp ) ) {
216
217
// Add each property of the leaf.
217
218
return addProperties ( updatePayload , nextProp , validAttributes ) ;
218
219
}
@@ -242,7 +243,7 @@ function clearNestedProperty(
242
243
return updatePayload ;
243
244
}
244
245
245
- if ( ! Array . isArray ( prevProp ) ) {
246
+ if ( ! isArray ( prevProp ) ) {
246
247
// Add each property of the leaf.
247
248
return clearProperties ( updatePayload , prevProp , validAttributes ) ;
248
249
}
0 commit comments