From 045738b4e9dab03eb83b5a73999a3d373e13fd6b Mon Sep 17 00:00:00 2001 From: Avery Date: Tue, 19 Apr 2022 20:37:28 -0400 Subject: [PATCH] Add duplicating children fix from preactjs/preact-custom-element#61 --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index e7db9f5..2de02b9 100644 --- a/src/index.js +++ b/src/index.js @@ -91,6 +91,10 @@ function connectedCallback() { ]; } + // Duplicating children fix for {shadow: false} + // https://github.com/preactjs/preact-custom-element/pull/61 + this.innerHTML = ''; + (this.hasAttribute('hydrate') ? hydrate : render)(this._vdom, this._root); }