News for hackers. Stuff that matters.
Re:Lit: Simple. Fast. Web Components by lcnPylGDnU4H9OF on Thursday July 20, 2023 @06:31PM (#36807646)
> makes it much harder to query things

This seems overstated. It’s different but not really harder.

  document.querySelector('my-lit-element').elementIWant

  class MyLitElement extends Lit {
    get elementIWant() {
      return this.renderRoot.querySelector(...);
    }
  }
Though, maybe one doesn’t like querying twice. I’m not sure of performance implications there, to be honest, but I’d expect it to be negligible in most cases.

There are no comments on this comment yet.