-
Notifications
You must be signed in to change notification settings - Fork 48.6k
Flare: ensure discrete event flush is disabled during initial DOM mount #15701
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
Flare: ensure discrete event flush is disabled during initial DOM mount #15701
Conversation
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: d7afe23...9da4c7f react-dom
Generated by 🚫 dangerJS |
Maybe we should just revert the warning entirely if it's causing problems? Until we can verify that this approach is correct, and write tests. If the point is to unblock the sync then we should change as little as possible about the current behavior. |
@acdlite I've added a regression test that confirms the expected behaviour. |
We will come back to this one in the future. Closing this in favour of #15702 |
When testing #15687 internally, we encountered some issues where the invariant in
flushDiscreteUpdates
fired during legit tests.The reason for this was because ReactDOM sets properties and attributes on elements on initial mount, which can also fire events on the DOM. We don't want these events to flush discrete events, so we now set a flag for this that we enable before setting DOM properties and then disable after setting them.
Furthermore, we felt that the
invariant
was maybe too strong, so this has been downgraded to a warning in DEV.