Skip to content

Commit

Permalink
Add a customElementRoot prop for registered Custom Elements
Browse files Browse the repository at this point in the history
Avoids the need to setup a Ref and query its parentElement to gain access to the root of the Custom Element.
  • Loading branch information
EmmanuelOga authored Jul 24, 2024
1 parent 9980548 commit 256f06d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 256f06d

Please sign in to comment.