lit-analyzer icon indicating copy to clipboard operation
lit-analyzer copied to clipboard

Treat noChange and nothing as any type in binding

Open rictic opened this issue 3 years ago • 1 comments

The noChange and nothing values have special meaning in a lit binding, and they are legal to use everywhere, as they directly specify behavior rather than an ordinary value to be set/rendered

rictic avatar Apr 25 '22 16:04 rictic

related https://github.com/runem/lit-analyzer/issues/207

outside of custom directives, you can also trigger analyzer errors using built-ins like the when directive:

html`
  <button
    tabindex=${when(someCondition, () => "-1", () => nothing)}
  ></button>
`

WickyNilliams avatar Apr 26 '22 11:04 WickyNilliams