matthewp / haunted

React's Hooks API implemented for web components 👻
BSD 2-Clause "Simplified" License
2.61k stars 92 forks source link

component options not working (lighterhtml) #132

Open s-areeb opened 5 years ago

s-areeb commented 5 years ago

TypeError: Illegal invocation on v4.5.3

Uncaught TypeError: Class extends value #<Object> is not a constructor or null on v4.5.1

codepen

codepen full view

matthewp commented 5 years ago

Options are the 3rd argument: https://github.com/matthewp/haunted#function-signatures

Pass HTMLElement as the second argument.

s-areeb commented 5 years ago

As per README there are two signatures for component function

component(renderer, options): Element and component(renderer, BaseElement, options): Element

Even when passing 2nd arg, i still get the same issue component(Counter , HTMLElement, { useShadowDOM: false })

Updated codepen with above

matthewp commented 5 years ago

Ok, I forgot about this. Will fix.