We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test case: https://codepen.io/cferdinandi/pen/GRmOyJJ
I have this code snippet where I am trying to pass two events into a component. However the second one that is used in the template throws a error:
let { signal, component, render } = reef; customElements.define('count-up', class extends HTMLElement { constructor() { super(); this.count = signal(0); let countUp = () => { this.count.value++; }; let startDrag = () => { console.log('startDrag'); }; this.events = { countUp: countUp, startDrag: startDrag }; component(this, this.template, { events: this.events }); } template = () => { return ` <div draggable="true" onmousedown="startDrag()"> <button onclick="countUp()">Clicked ${this.count.value} times</button> </div> `; } });
Uncaught ReferenceError: countUp is not defined at HTMLButtonElement.onclick ((index):1:1)
The text was updated successfully, but these errors were encountered:
Definitely a bug, seemingly the same one here: #200
Closing this issue only because it's a duplicate of an existing bug that already has some chat around it, but linking the two as related.
Thanks for filing this!
Sorry, something went wrong.
No branches or pull requests
Test case: https://codepen.io/cferdinandi/pen/GRmOyJJ
I have this code snippet where I am trying to pass two events into a component. However the second one that is used in the template throws a error:
The text was updated successfully, but these errors were encountered: