-
Notifications
You must be signed in to change notification settings - Fork 866
Open
Description
Issue
You cannot extend an HTMLELement and call super() in the constructor.
I get an illegal constructor exception when I use emoji-mart in a NextJS application. First render on the server is fine, but second render on the client (navigate back and forth) will throw an exception.
Code Location
https://github.com/missive/emoji-mart/blob/main/packages/emoji-mart/src/components/HTMLElement/HTMLElement.ts#L15
const WindowHTMLElement =
typeof window !== 'undefined' && window.HTMLElement
? window.HTMLElement // should not extend this
: Object
class HTMLElementTest extends WindowHTMLElement {
constructor() {
super(); // Illegal constructor
}
do(): void {
console.log('Hello World');
}
}
const test = new HTMLElementTest();
test.do();
Metadata
Metadata
Assignees
Labels
No labels