Skip to content

Commit

Permalink
fix: secure wrapped/uwrapped comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Dec 17, 2018
1 parent da7b662 commit a62bacd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/reconciler/componentComparator.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ const compareComponents = (oldType, newType, setNewType) => {
return defaultResult
}

if (newType !== oldType && areSwappable(newType, oldType)) {
if (
newType !== oldType &&
areSwappable(newType, oldType) &&
!!oldType[PROXY_KEY] == !!newType[PROXY_KEY]
) {
const unwrapFactory = newType[UNWRAP_PROXY]
const oldProxy = unwrapFactory && getProxyByType(unwrapFactory())
if (oldProxy) {
Expand Down

0 comments on commit a62bacd

Please sign in to comment.