@@ -12,6 +12,7 @@ import {
1212 deepDiffer ,
1313 flattenStyle ,
1414} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ;
15+ import isArray from 'shared/isArray' ;
1516
1617import type { AttributeConfiguration } from './ReactNativeTypes' ;
1718
@@ -51,7 +52,7 @@ function restoreDeletedValuesInNestedArray(
5152 node : NestedNode ,
5253 validAttributes : AttributeConfiguration ,
5354) {
54- if ( Array . isArray ( node ) ) {
55+ if ( isArray ( node ) ) {
5556 let i = node . length ;
5657 while ( i -- && removedKeyCount > 0 ) {
5758 restoreDeletedValuesInNestedArray (
@@ -163,12 +164,12 @@ function diffNestedProperty(
163164 return updatePayload ;
164165 }
165166
166- if ( ! Array . isArray ( prevProp ) && ! Array . isArray ( nextProp ) ) {
167+ if ( ! isArray ( prevProp ) && ! isArray ( nextProp ) ) {
167168 // Both are leaves, we can diff the leaves.
168169 return diffProperties ( updatePayload , prevProp , nextProp , validAttributes ) ;
169170 }
170171
171- if ( Array . isArray ( prevProp ) && Array . isArray ( nextProp ) ) {
172+ if ( isArray ( prevProp ) && isArray ( nextProp ) ) {
172173 // Both are arrays, we can diff the arrays.
173174 return diffNestedArrayProperty (
174175 updatePayload ,
@@ -178,7 +179,7 @@ function diffNestedProperty(
178179 ) ;
179180 }
180181
181- if ( Array . isArray ( prevProp ) ) {
182+ if ( isArray ( prevProp ) ) {
182183 return diffProperties (
183184 updatePayload ,
184185 // $FlowFixMe - We know that this is always an object when the input is.
@@ -212,7 +213,7 @@ function addNestedProperty(
212213 return updatePayload ;
213214 }
214215
215- if ( ! Array . isArray ( nextProp ) ) {
216+ if ( ! isArray ( nextProp ) ) {
216217 // Add each property of the leaf.
217218 return addProperties ( updatePayload , nextProp , validAttributes ) ;
218219 }
@@ -242,7 +243,7 @@ function clearNestedProperty(
242243 return updatePayload ;
243244 }
244245
245- if ( ! Array . isArray ( prevProp ) ) {
246+ if ( ! isArray ( prevProp ) ) {
246247 // Add each property of the leaf.
247248 return clearProperties ( updatePayload , prevProp , validAttributes ) ;
248249 }
0 commit comments