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 act not flushing effects/updates if global effect/update queues are non-empty before act call #1851

Merged
merged 2 commits into from
Aug 11, 2019

Commits on Aug 10, 2019

  1. Schedule effect/update queue flushes if hooks change

    When scheduling a state update or effect, check whether the
    `options.{debounceRendering, requestAnimationFrame}` hooks changed since
    an update/effect queue flush was last scheduled and schedule a flush
    using the new hooks if so.
    
    This fixes an issue where a call to `act` would fail to synchronously flush
    state updates and effects if a flush was already scheduled but not yet executed
    before `act` was called. This happened because when a state update or effect was
    queued during the `act` callback, if the global update/effect queues were
    non-empty then the temporary hooks installed by `act` to facilitate
    synchronously flushing the queue would not be called.
    
    More generally, this fixes an issue where any changes to the scheduling hooks
    do not take effect until any already-scheduled flushes have happened.
    
    Fixes #1794
    robertknight committed Aug 10, 2019
    Configuration menu
    Copy the full SHA
    fba364a View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2019

  1. Configuration menu
    Copy the full SHA
    8f4fb12 View commit details
    Browse the repository at this point in the history