From ed2fea9b898e9dc45df2e7daab15597878332136 Mon Sep 17 00:00:00 2001 From: divya2212001 Date: Tue, 2 Dec 2025 15:15:02 +0530 Subject: [PATCH 1/2] issue 1430 --- src/pure.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pure.js b/src/pure.js index 0f9c487d..e3aa7609 100644 --- a/src/pure.js +++ b/src/pure.js @@ -283,14 +283,15 @@ function render( // they're passing us a custom container or not. mountedContainers.add(container) } else { - mountedRootEntries.forEach(rootEntry => { + const rootEntry = mountedRootEntries.find( + rootEntry => rootEntry.container === container + ) // Else is unreachable since `mountedContainers` has the `container`. // Only reachable if one would accidentally add the container to `mountedContainers` but not the root to `mountedRootEntries` /* istanbul ignore else */ - if (rootEntry.container === container) { - root = rootEntry.root - } - }) + if (rootEntry) { + root = rootEntry.root + } } return renderRoot(ui, { From 1b196eaa83d4e1f69ea9152547d9052841cfc739 Mon Sep 17 00:00:00 2001 From: divya2212001 Date: Tue, 2 Dec 2025 17:09:08 +0530 Subject: [PATCH 2/2] issue #1430 --- src/pure.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pure.js b/src/pure.js index e3aa7609..761cf3de 100644 --- a/src/pure.js +++ b/src/pure.js @@ -283,15 +283,16 @@ function render( // they're passing us a custom container or not. mountedContainers.add(container) } else { - const rootEntry = mountedRootEntries.find( - rootEntry => rootEntry.container === container + const entry = mountedRootEntries.find( + rootEntry => rootEntry.container === container, ) - // Else is unreachable since `mountedContainers` has the `container`. - // Only reachable if one would accidentally add the container to `mountedContainers` but not the root to `mountedRootEntries` - /* istanbul ignore else */ - if (rootEntry) { - root = rootEntry.root + + if (entry) { + root = entry.root } + // Else is unreachable since `mountedContainers` has the `container`. + // Only reachable if one would accidentally add the container to `mountedContainers` but not the root to `mountedRootEntries` + /* istanbul ignore else */ } return renderRoot(ui, {