@@ -31,6 +31,31 @@ export function deepEqual<A, B>(obj1: A, obj2: B) {
31
31
}
32
32
return true ;
33
33
}
34
+ // If objects are VNodes, compare their props only
35
+ if (
36
+ // eslint-disable-next-line no-prototype-builtins
37
+ obj1 . hasOwnProperty ( 'constructor' ) &&
38
+ // eslint-disable-next-line no-prototype-builtins
39
+ obj2 . hasOwnProperty ( 'constructor' ) &&
40
+ // eslint-disable-next-line no-prototype-builtins
41
+ obj1 . hasOwnProperty ( 'props' ) &&
42
+ // eslint-disable-next-line no-prototype-builtins
43
+ obj2 . hasOwnProperty ( 'props' ) &&
44
+ // eslint-disable-next-line no-prototype-builtins
45
+ obj1 . hasOwnProperty ( 'key' ) &&
46
+ // eslint-disable-next-line no-prototype-builtins
47
+ obj2 . hasOwnProperty ( 'key' ) &&
48
+ // eslint-disable-next-line no-prototype-builtins
49
+ obj1 . hasOwnProperty ( 'ref' ) &&
50
+ // eslint-disable-next-line no-prototype-builtins
51
+ obj2 . hasOwnProperty ( 'ref' ) &&
52
+ // eslint-disable-next-line no-prototype-builtins
53
+ obj1 . hasOwnProperty ( 'type' ) &&
54
+ // eslint-disable-next-line no-prototype-builtins
55
+ obj2 . hasOwnProperty ( 'type' )
56
+ ) {
57
+ return deepEqual ( obj1 [ 'props' ] , obj2 [ 'props' ] ) ;
58
+ }
34
59
// If objects are both objects, compare their properties recursively
35
60
const keys1 = Object . keys ( obj1 ) ;
36
61
const keys2 = Object . keys ( obj2 ) ;
0 commit comments