I have a class that extends HTMLElement
. From reading this thread
https://github.com/Microsoft/TypeScript/issues/574#issuecomment-231683089
I see that I can't instantiate a custom element with out getting a Illegal constructor
. Additionally, the registerElement
looked promising as it returned the constructor for the custom element but that is now deprecated for using CustomElementRegistry.define()
that 1. exists on the window object and 2. returns void. Any solutions will be greatly appreciated thank you.
for this particular setup I am attempting to use native custom elements as opposed to a web component framework because I only need custom elements. Also, I am using TypeScript and attempting to use Jest to test it.