diff --git a/src/pure.js b/src/pure.js index 0f9c487d..761cf3de 100644 --- a/src/pure.js +++ b/src/pure.js @@ -283,14 +283,16 @@ function render( // they're passing us a custom container or not. mountedContainers.add(container) } else { - mountedRootEntries.forEach(rootEntry => { - // 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 - } - }) + const entry = mountedRootEntries.find( + rootEntry => rootEntry.container === container, + ) + + 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, {