Skip to content

Commit a62bacd

Browse files
committed
fix: secure wrapped/uwrapped comparison
1 parent da7b662 commit a62bacd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/reconciler/componentComparator.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ const compareComponents = (oldType, newType, setNewType) => {
4949
return defaultResult
5050
}
5151

52-
if (newType !== oldType && areSwappable(newType, oldType)) {
52+
if (
53+
newType !== oldType &&
54+
areSwappable(newType, oldType) &&
55+
!!oldType[PROXY_KEY] == !!newType[PROXY_KEY]
56+
) {
5357
const unwrapFactory = newType[UNWRAP_PROXY]
5458
const oldProxy = unwrapFactory && getProxyByType(unwrapFactory())
5559
if (oldProxy) {

0 commit comments

Comments
 (0)