You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using preact/debug, which most Preact users will use in dev, #4349 addresses this.
React does seem to also detect infinite loops in prod too so I think we'll keep this open for the moment to better gauge whether we need a check/limit in preact/compat (or preact itself, I suppose)
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: