preactjs / preact-compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.
http://npm.im/preact-compat
MIT License
950 stars 148 forks source link

Fix VNode constructor being undefined #540

Closed AugustinGrigorov closed 4 years ago

AugustinGrigorov commented 4 years ago

Constructor is sometimes undefined for me creating an error. Initialising it to a function when it is fixes the issue for me.

marvinhagemeister commented 4 years ago

Thanks for making a PR 🎉 I'm curious to know more about the scenario where this error occurs. In Preact 8.x VNode was a class and certainly has a constructor. Can you double check that you're really using Preact 8.x?

We've got some reports in the past where users were trying to use preact-compat (=written for 8.x) with Preact X.

AugustinGrigorov commented 4 years ago

Yes that was the problem. Thanks for pointing that out. Closing this PR now.