Skip to content

Commit

Permalink
fix: regression of registered type comparison, fixes #1284
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jul 4, 2019
1 parent 1b9f2da commit 49851be
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/reconciler/componentComparator.js
Expand Up @@ -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 };
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 49851be

Please sign in to comment.