From 357249c42540912930b46534ebdfe7e924913f68 Mon Sep 17 00:00:00 2001 From: Anton Korzunov Date: Thu, 4 Jul 2019 19:11:32 +1000 Subject: [PATCH] fix: prevent different typeof of components to be merged --- src/reconciler/componentComparator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reconciler/componentComparator.js b/src/reconciler/componentComparator.js index c3eda16ae..04601b886 100644 --- a/src/reconciler/componentComparator.js +++ b/src/reconciler/componentComparator.js @@ -99,8 +99,8 @@ const areDeepSwappable = (oldType, newType) => { const compareComponents = (oldType, newType, setNewType, baseType) => { let defaultResult = oldType === newType; - if ((oldType && !newType) || (!oldType && newType)) { - return false; + if ((oldType && !newType) || (!oldType && newType) || typeof oldType !== typeof newType) { + return defaultResult; } if (getIdByType(oldType)) {