From 49851bede75f010c31b06e408e9c805c87e6a3fd Mon Sep 17 00:00:00 2001 From: Anton Korzunov Date: Thu, 4 Jul 2019 20:26:27 +1000 Subject: [PATCH] fix: regression of registered type comparison, fixes #1284 --- src/reconciler/componentComparator.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/reconciler/componentComparator.js b/src/reconciler/componentComparator.js index a48ed74e1..f86379abd 100644 --- a/src/reconciler/componentComparator.js +++ b/src/reconciler/componentComparator.js @@ -69,15 +69,8 @@ const areSignaturesCompatible = (a, b) => { return true; }; -const compareRegistered = (a, b) => { - if (getIdByType(a) === getIdByType(b)) { - if (getProxyByType(a) !== getProxyByType(b)) { - return false; - } - } - - return areSignaturesCompatible(a, b); -}; +const compareRegistered = (a, b) => + getIdByType(a) === getIdByType(b) && getProxyByType(a) === getProxyByType(b) && areSignaturesCompatible(a, b); const areDeepSwappable = (oldType, newType) => { const type = { type: oldType }; @@ -109,12 +102,13 @@ const compareComponents = (oldType, newType, setNewType, baseType) => { (oldType && !newType) || (!oldType && newType) || typeof oldType !== typeof newType || - getElementType(oldType) !== getElementType(newType) + getElementType(oldType) !== getElementType(newType) || + 0 ) { return defaultResult; } - if (getIdByType(oldType)) { + if (getIdByType(newType) || getIdByType(oldType)) { if (!compareRegistered(oldType, newType)) { return false; }