Currently, when using a Stencil web component you can add an event listener like:
Ideally, this should work too:
myComponent.onfoobar = fn;
But currently it doesn’t work, and this prevents me from using the Stencil web component with JSX in other virtual-doms. As far as I know, this is because simple vdom implementations do not use
addEventListener and instead assign to the event property so the events can be transferred more easily during patching.
Is this something that has been considered before? I think it would improve interoperability with other libraries, and also match the expectation that users have with native events.