Open Tokitaka opened 2 months ago
If we try to perform DOM manipulation such as document.getElementById('map)
with Typescript,
I hope it is recognized as type HTMLElement
by Typescript.
In error message,
Argument of type 'HTMLElement | null' is not assignable to parameter of type 'HTMLElement'.
Type 'null' is not assignable to type 'HTMLElement'.
To inform Typescript that the returned value is an HTMLElement
, explicitly cast the value using
document.getElementById('map') as HTMLElement
DOM manipulation with Typescript