lit / lit-element

LEGACY REPO. This repository is for maintenance of the legacy LitElement library. The LitElement base class is now part of the Lit library, which is developed in the lit monorepo.
https://lit-element.polymer-project.org
BSD 3-Clause "New" or "Revised" License
4.49k stars 318 forks source link

Question: @query no resolving? #1118

Closed fireflysemantics closed 3 years ago

fireflysemantics commented 3 years ago

Wondering if someone might be able to help with this?

https://stackoverflow.com/questions/65129078/using-query-with-litelement-and-typescript

sorvell commented 3 years ago

You can use a ! after the property name. This tells Typescript that the value will be set.

@query('#gist')
gist!: HTMLIFrameElement|null;