Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

Using event properties instead of addEventListener

$
0
0

@elclanrs wrote:

Currently, when using a Stencil web component you can add an event listener like:

myComponent.addEventListener('foobar', fn);

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>