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
If useState's setState is called in a closed window, it hangs the browser (at least Chrome). I agree that this seems like a weird issue, but we do this all of the time in our plugin we've built for an application that has iframe based UI.
This reproduces it. Just click "Do it". Note that your codesandbox service worker will spin up to 100% cpu and I can't figure out a way to stop it other than to kill that task in the Chrome task manager
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
If useState's setState is called in a closed window, it hangs the browser (at least Chrome). I agree that this seems like a weird issue, but we do this all of the time in our plugin we've built for an application that has iframe based UI.
This reproduces it. Just click "Do it". Note that your codesandbox service worker will spin up to 100% cpu and I can't figure out a way to stop it other than to kill that task in the Chrome task manager
https://codesandbox.io/s/react-setstate-on-hidden-window-hangs-repro-cixqn
What is the expected behavior?
No hang, it should just ignore the setState call, ideally.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
16.9. I'm not sure, but hooks are fairly new. This reproduces in Chrome 76, but not Firefox as far as I can tell.
The text was updated successfully, but these errors were encountered: