Closed jacek-jablonski closed 9 months ago
Unfortunately SVG does not know what you pass in and will always return a Dom-Type which is the best guess it can do.
That is the same problem as document.querySelector('.someClass')
has. It will not give you back the specific HTML element type but just a generic HTMLElement.
The correct approach here is to type cast canvas to the appropriate type because in this circumstances you know more than typescript and thats what casting is for
Thanks for explanation!
With below example:
TS error occurs:
Property 'rect' does not exist on type 'Dom'.ts(2339)
.Should the typings be fixed or am I missing something?