We have a project that uses Preact that was mostly written when 10.0.0 was released. After updating to the latest Preact version, I'm getting a runtime error when mounting certain components.

After some digging I realized that this is happening upon mounting components that use hooks. Moreover, I performed a bisect on Preact version dependencies and found out that it starts to break from Preact 10.5.6 upwards (all other previous versions are fine).
To Reproduce
Unfortunately it's hard to isolate into a smaller project since the Preact part is only a small part of the whole project.
For now I've converted the affected components into class components and got things working again on the latest Preact.