Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class HTMLElementWithRefs extends HTMLElement {
constructor () {
this.refs = new Proxy({}, {
get: this.__getFromShadowRoot.bind(this)
__getFromShadowRoot (target, name) {
return this.shadowRoot.querySelector('[ref="' + name + '"]');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.