-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspense component.__hooks might be null #3066
Comments
As of |
@davidrhoderick does the error happen when you modify hook state after a component is suspended? Or is something else triggering rendering? A few of the comments in the linked issue mention this only happens with Suspense from |
It's a rather complex application so I am not able to quickly test that but I can definitely tell you that hook state is being modified in suspended components. Also suspended components load other suspended components. |
Same issue here |
This has been fixed with 10.18.1 1658d43 |
Describe the bug
There seems to be a regression with lazy Suspense and hooks, triggering this error message
Cannot set property __h of null
, resulting in the component infinitely rendering the fallback markup.Everything seems to work fine until preact 10.5.4. First broken version seems to be preact 10.5.5.
Changing this condition
preact/hooks/src/index.js
Line 295 in e523a82
to
if (component._parentDom && component.__hooks)
seems to fix the issue. But I don't have enough understanding of the preact core to tell if that is the right approach & place to fix it.To Reproduce
#2488
Expected behavior
Suspense switches out of fallback.
The text was updated successfully, but these errors were encountered: