Skip to content
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

Fix serial passive effects #15650

Merged
merged 2 commits into from May 15, 2019
Merged

Commits on May 14, 2019

  1. Failing test for false positive warning

    gaearon authored and acdlite committed May 14, 2019
    Copy the full SHA
    ead0ccc View commit details
    Browse the repository at this point in the history
  2. Flush passive effects before discrete events

    Currently, we check for pending passive effects inside the `setState`
    method before we add additional updates to the queue, in case those
    pending effects also add things to the queue.
    
    However, the `setState` method is too late, because the event that
    caused the update might not have ever fired had the passive effects
    flushed before we got there.
    
    This is the same as the discrete/serial events problem. When a serial
    update comes in, and there's already a pending serial update, we have to
    do it before we call the user-provided event handlers. Because the event
    handlers themselves might change as a result of the pending update.
    
    This commit moves the `flushPassiveEffects` call to before the discrete
    event handlers are called, and removes it from the `setState` method.
    Non-discrete events will not cause passive effects to flush, which is
    fine, since by definition they are not order dependent.
    acdlite committed May 14, 2019
    Copy the full SHA
    cb56090 View commit details
    Browse the repository at this point in the history