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
Component re-renders indefinitely when changing state on render #3959
Comments
When using
Edit: Per Jovi, probably a bug. Whoops! |
We do already have a check in place that it doesn't infinitely render but I reckon that maybe it still pushes to the |
Describe the bug
When changing state on render Preact will re-render indefinitely rather than throwing a "Too many re-renders" error.
To Reproduce
codesandbox
Expected behavior
Logs
rendering 0
torendering 24
, then throws "Too many re-renders" error (similar to React - thrown here)Actual behavior
Logs
rendering 0
torendering 49
. If you remove thererenderCount < 50
conditional, it will run indefinitely and crash the browser.The text was updated successfully, but these errors were encountered: