From 34e08ff600061350250ebcd79dae5873eebb6051 Mon Sep 17 00:00:00 2001 From: Trezy Date: Thu, 4 Jul 2024 22:58:52 -0500 Subject: [PATCH] fix: remove false positive invariant when changing a component's children fixes #493 --- src/helpers/insertBefore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/insertBefore.js b/src/helpers/insertBefore.js index a70f40f9..b3fee727 100644 --- a/src/helpers/insertBefore.js +++ b/src/helpers/insertBefore.js @@ -12,7 +12,7 @@ export function insertBefore(parentInstance, childInstance, beforeChildInstance) { log('info', 'lifecycle::insertBefore'); - invariant(childInstance === beforeChildInstance, 'Cannot insert node before itself'); + invariant(childInstance !== beforeChildInstance, 'Cannot insert node before itself'); if (parentInstance.children.indexOf(childInstance) === -1) {