Skip to content

How to resolve "Use vDOM listener instead" #10

@chris-dura

Description

@chris-dura

Noobie question — I’m using an example straight from the Stencil docs…

@Listen('keydown')
handleKeyDown(ev: KeyboardEvent){
  if (ev.key === 'ArrowDown'){
    console.log('down arrow pressed')
  }
}

I get an error Use vDOM listener instead, and I don’t exactly know how to resolve that… 😬
In other words, I don't exactly know how to "use a vDOM listener instead".

Also, according to the rule docs, this rule is meant to "Ensures that no vdom events are used in @Listen decorator." Why is it bad to listen to vDOM events using the @Listen decorator?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions