Skip to content

Commit 38dd17a

Browse files
motiz88gaearon
authored andcommitted
[RN] Hoist static deepDiffer options object (#17303)
1 parent 61d3dd0 commit 38dd17a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ type NestedNode = Array<NestedNode> | Object;
3232
let removedKeys = null;
3333
let removedKeyCount = 0;
3434

35+
const deepDifferOptions = {
36+
unsafelyIgnoreFunctions: true,
37+
};
38+
3539
function defaultDiffer(prevProp: mixed, nextProp: mixed): boolean {
3640
if (typeof nextProp !== 'object' || nextProp === null) {
3741
// Scalars have already been checked for equality
3842
return true;
3943
} else {
4044
// For objects and arrays, the default diffing algorithm is a deep compare
41-
return deepDiffer(prevProp, nextProp, {unsafelyIgnoreFunctions: true});
45+
return deepDiffer(prevProp, nextProp, deepDifferOptions);
4246
}
4347
}
4448

0 commit comments

Comments
 (0)