From 256f06de7560ce8b30dd889c14248c5222936acf Mon Sep 17 00:00:00 2001 From: Emmanuel Oga Date: Tue, 23 Jul 2024 23:46:27 -0700 Subject: [PATCH] Add a `customElementRoot` prop for registered Custom Elements Avoids the need to setup a Ref and query its parentElement to gain access to the root of the Custom Element. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index f82fbd5..7a54709 100644 --- a/src/index.js +++ b/src/index.js @@ -125,7 +125,7 @@ function connectedCallback() { this._vdom = h( ContextProvider, - { ...this._props, context }, + { customElementRoot: this._root, ...this._props, context }, toVdom(this, this._vdomComponent) ); (this.hasAttribute('hydrate') ? hydrate : render)(this._vdom, this._root);