-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
useResizeObserver: handle strict mode double effects #47703
Conversation
I tested only in local dev mode for now.
Screen.Recording.2023-02-02.at.7.42.53.PM.movThere might be more issues though.. I haven't tested thoroughly.. |
I confirm what @ntsekouras says — the site editor is back, but sometimes the undo button does not activate, and the "restore" banner appears twice. As Nik mentions, there could likely be more issues that we may find by testing this PR. Maybe the better idea is to revert the offending PR, and work on a fix with less urgency? I'm just afraid that we'd introduce more regressions without careful testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably merge this hotfix while still reverting the original Strict Mode PR
Do we need to add regression tests for this? I guess it should have been caught in the original PR (where we enabled the Strict Mode). |
To catch this, we'd have to run the e2e tests against a development build. In production mode, strict mode doesn't do anything. Only in dev it does things like re-mounting effects, exposing bugs like this one. |
There is some bug in the |
Fixes
useResizeObserver
in strict mode. Which unmounts and remounts effects twice, and the second mount didn't updatedidUnmount.current
back tofalse
, so the hook was considered permanently unmounted.